Page 1 of 1

Error in creating a DB2 table

Posted: Thu Jun 07, 2007 12:25 pm
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,

Posted: Thu Jun 07, 2007 3:27 pm
by ArndW
Have you tried entering this SQL directly to see if the same error occurs - and if it might give more output?

Posted: Fri Jun 08, 2007 8:14 am
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

Posted: Fri Jun 08, 2007 8:25 am
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.