Midrange News for the IBM i Community


Posted by: Ralph Miller
Contract RPG Legacy Programmer
Self
Franklin, TN
SQL7008
has no ratings.
Published: 02 Feb 2014
Revised: 03 Feb 2014 - 1144 days ago
Last viewed on: 23 Mar 2017 (2464 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

SQL7008 Published by: Ralph Miller on 02 Feb 2014 view comments(4)

We are experiencing an issue with tables created on the iSeries using sql and a pc connection(ODBC).
The table gets created but the programmer gets an error msg sql7008 when trying to update(insert) the table.
If the table is recreated using DDS instead of sql - the problem goes away. This seems to only occur
when the table contains integer fields. If all the fields are char, no problem. Thanks. (V7R1)

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: SQL7008
Posted: 3 years 1 months 19 days 2 hours 50 minutes ago
Edited: Mon, 03 Feb, 2014 at 08:52:20 (1144 days ago)

Looks like Commitment Control may be the issue or perhaps NULL-capable defaults on ODBC vs DB2/400.

Check out this link: http://www.querytool.com/help/876.htm

Posted by: RalphAMiller
Premium member *
Franklin, TN
Comment on: SQL7008
Posted: 3 years 1 months 18 days 10 hours 54 minutes ago

Thank you Bob - I added a little more detail regarding the sql problem. I copied and pasted the verbiage below from an

email I got from the programmer involved.  Thanks.

 

I can create views based on any existing table
and I can create new tables with no issue
unless they contain numeric fields.

Executing this from an ODBC link works fine:

CREATE TABLE HEFILE.XOX
 (VNAME VARCHAR(40),
 HERMVEND VARCHAR(10),
 XOVEND VARCHAR(10));

However, if you I change the data type
of a column to INTEGER it fails.

CREATE TABLE HEFILE.XOX
 (VNAME VARCHAR(40),
 HERMVEND INTEGER,
 XOVEND INTEGER);

 

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: SQL7008
Posted: 3 years 1 months 18 days 6 hours 15 minutes ago
CREATE TABLE HEFILE.XOX (VNAME VARCHAR(40),
HERMVEND INTEGER NOT NULL DEFAULT 0, XOVEND INTEGER NOT NULL DEFAULT 0 ) 
Posted by: RalphAMiller
Premium member *
Franklin, TN
Comment on: SQL7008
Posted: 3 years 1 months 18 days 5 hours 3 minutes ago

Thanks once again Sir!