Error in creating a DB2 table

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mouthou
Participant
Posts: 208
Joined: Sun Jul 04, 2004 11:57 pm

Error in creating a DB2 table

Post by mouthou »

Hi everyone,

I am trying to load some data into a DB2 table on AS/400. I am checking option of creating the table in the ODBC stage. But it is giving errors.

testMMScreate..DBAPVEN_MMS_AS.lnkDBAPVEN_AS: DSD.BCIOpenW call to SQLExecDirect failed.
CREATE TABLE TRO/DBAPVEN1(VENDOR_GROUP CHAR(4) NOT NULL, VENDOR CHAR(9) NOT NULL PRIMARY KEY)
SQLSTATE=S1000, DBMS.CODE=-5016
[DataStage][SQL Client][ODBC][DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for iSeries and AS/400]Unknown error: SQLCODE -5016



When I checked the option, it created the DDL as below:
CREATE TABLE #$MMSLib#/DBAPVEN1(VENDOR_GROUP CHAR(4) NOT NULL, VENDOR CHAR(9) NOT NULL PRIMARY KEY);

Is there anything wrong I am doing?

Thanks in advance,
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Have you tried entering this SQL directly to see if the same error occurs - and if it might give more output?
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

mouthou :
Are you sure you were able to create the table ?

But when I tried to run your query

Code: Select all

CREATE TABLE user2/DBAPVEN1(VENDOR_GROUP CHAR(4) NOT NULL, VENDOR CHAR(9) NOT NULL PRIMARY KEY)
but i got following error

Code: Select all

SQL0104N  An unexpected token "/" was found following "CREATE 
TABLE user2".  Expected tokens may include:  "OF     


I guess "/" is the problem, that is why datastage throws error
mouthou
Participant
Posts: 208
Joined: Sun Jul 04, 2004 11:57 pm

Post by mouthou »

I guess that is not the issue. I assume that you are running the query on AS/400.

Type SQL statement, press Enter.
> CREATE TABLE TRO/DBAPVEN2(VENDOR_GROUP CHAR(4) NOT NULL, VENDOR CHAR(9) NOT NULL PRIMARY KEY)
Table DBAPVEN2 in TRO created but could not be journaled.
Post Reply