Inserting the data into db2 using db2 connector stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

Inserting the data into db2 using db2 connector stage

Post by developeretl »

Hi All,
Iam new to datastage... Iam trying insert the data in the table... but iam not able to insert the data .. do i need to write the insert statement for the values which iam going to insert??
Can you please guide me how to insert data by using the insert statement.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Re: Inserting the data into db2 using db2 connector stage

Post by kris007 »

You will have to give us more details on what you are trying to do in your datastage job and what is not working, what stages you are using and the database you are connecting to. What are the options you are using within the database stage? Upsert or User defined updated sql etc etc
Kris

Where's the "Any" key?-Homer Simpson
developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

Re: Inserting the data into db2 using db2 connector stage

Post by developeretl »

kris007 wrote:You will have to give us more details on what you are trying to do in your datastage job and what is not working, what stages you are using and the database you are connecting to. What are the options you are using within the database stage? Upsert or User defined updated sql etc etc
Hi Kris,
Iam inserting the data into the db2 using DB2 connector stage.... i gave db name,username,password ,table name and mentioned to generate SQL to yes. Insert option. Table is empty with the column names. Iam inserting the data in the empty table but i keep getting the error unable to insert the values ....
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Can you post the complete error message from the log including the SQL codes. Looks like a permissions issue to me. If you can, please post the generated SQL as well.
Kris

Where's the "Any" key?-Homer Simpson
developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

Post by developeretl »

kris007 wrote:Can you post the complete error message from the log including the SQL codes. Looks like a permissions issue to me. If you can, please post the generated SQL as well.
DB2_Connector_226,1: [IIS-CONN-DB2-000004] DB2 function SQLExecute failed: SQLSTATE = 23502: Native Error Code = -407: Msg = [IBM][CLI Driver][DB2/AIX64] SQL0407N Assignment of a NULL value to a NOT NULL column "TBSPACEID=2, TABLEID=270, COLNO=2" is not allowed. SQLSTATE=23502 (CC_DB2DBStatement::executeInsert, file CC_DB2DBStatement.cpp, line 563)
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Well...the error message says it all. You are trying to insert NULL values into a NOT NULLABLE field on the table. You either have to check your data or assign default values when the value is NULL.
Kris

Where's the "Any" key?-Homer Simpson
Post Reply