cancel
Showing results for 
Search instead for 
Did you mean: 

Error : Inserting data in to DB2

Former Member
0 Kudos

Hello all,

Iam trying to insert data to Db2 Database using the JDBC adapter.

But It is throwing an error :

<b>

Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SAPTESTLIB.SEFPTINDT' (structure 'Statement'): java.sql.SQLException: [SQL0104] Token 1 was not valid. Valid tokens: ) ,</b>

SAPTESTLIB is the Library name

SEFPTINDT table name

I have tried giving the SAPTESTLIB/SEFPTINDT even then it is giving the same error.

Generated Log ::

INSERT INTO SAPTESTLIB.SEFPTINDT (ITSTTS, ITOVRD, ITDIVSN, ITINNO, ITINSLNO, ITINDT, ITINTY, ITORTY, ITORNO, ITORDT, ITMOCD, ITCHAS, ITVIN, ITCUST, ITUSN, ITJBNO, ITJBCD, ITJBTY, ITPTNO, ITPTNM, ITQNTY, ITUOM, ITJBSTDT, ITJBSTTM, ITRGNO, ITCUGR, ITVHTY, ITLVTY, ITPTFRAN, ITPTBRCD, ITPNABRCD, ITPNAFRAN, ITPNANO, ITRFDOCTY, ITRFDOCNO, ITSPED, ITQTFRAN, ITQTBRCD, ITQTPX, ITQTNO, ITSPLIT, ITWRCAT, ITOVRRSCD, ITUSID, ITRCDT, ITRCTM, ITLUDT, ITLUTM, ITLUPG) VALUES (C, C, C, Str 2, 11, 19990124, C, C, Str 1, 19990124, Str 7, Str 5, Str 6, Str 15, This is a string 10, C, Str 12, C, Str 13, Str 14, 16, C, 19990124, 153345, Str 8, C, C, Str 9, C, 17, 22, C, Str 23, C, Str 19, 24, C, 20, Str 21, Str 21, C, C, Str 4, Str 3, 19990124, 153345, 19990124, 153345, Str 25)

Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SAPTESTLIB.SEFPTINDT' (structure 'Statement'): java.sql.SQLException: [SQL0104] Token 1 was not valid. Valid tokens: ) ,.

nable to execute statement for table or stored procedure. 'SAPTESTLIB.SEFPTINDT' (Structure 'Statement') due to java.sql.SQLException: [SQL0104] Token 1 was not valid. Valid tokens: ) ,.

Regards

Gangaprasad

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

>>>Str 1

Check this. What is the data type for this field. Does it allow empty space?

Execute the same stmt in AS400 system and trace the error. Try to get help from your DB/AS 400 guy.

Regards,

Jai Shankar

justin_santhanam
Active Contributor
0 Kudos

Prasad,

Which document format are u using?I mean the target structure!!

raj.

former_member189387
Active Contributor
0 Kudos

Hi ,

<i>INSERT INTO SAPTESTLIB.SEFPTINDT (ITSTTS, ITOVRD, ITDIVSN, ITINNO, ITINSLNO, ITINDT, ITINTY, ITORTY, ITORNO, ITORDT, ITMOCD, ITCHAS, ITVIN, ITCUST, ITUSN, ITJBNO, ITJBCD, ITJBTY, ITPTNO, ITPTNM, ITQNTY, ITUOM, ITJBSTDT, ITJBSTTM, ITRGNO, ITCUGR, ITVHTY, ITLVTY, ITPTFRAN, ITPTBRCD, ITPNABRCD, ITPNAFRAN, ITPNANO, ITRFDOCTY, ITRFDOCNO, ITSPED, ITQTFRAN, ITQTBRCD, ITQTPX, ITQTNO, ITSPLIT, ITWRCAT, ITOVRRSCD, ITUSID, ITRCDT, ITRCTM, ITLUDT, ITLUTM, ITLUPG) VALUES (C, C, C, Str 2, 11, 19990124, C, C, Str 1, 19990124, Str 7, Str 5, Str 6, Str 15, This is a string 10, C, Str 12, C, Str 13, Str 14, 16, C, 19990124, 153345, Str 8, C, C, Str 9, C, 17, 22, C, Str 23, C, Str 19, 24, C, 20, Str 21, Str 21, C, C, Str 4, Str 3, 19990124, 153345, 19990124, 153345, Str 25)</i>

Please check the values and datatype for Column . It shuold match .

Regards,

V.Rangarajan

Former Member
0 Kudos

Hello Rajan,

Thanks for your reply,

Datatypes are not matching ,while inserting the data in Database String should be in

Single Quotes.But here Query generated does not have the singlequotes.

I have used hasQuot attribute also .But it gives the same error and same query is generated.

Regards

GangaPrasad

Former Member
0 Kudos

If you are sure of quotes then use concatenate function in mapping & add quote to the values which you are tryng to insert. It will definitely create query with quotes.

Also try to manually insert the data into DB2 with the same values as mentioned in ur post directly on DB2 screens with the help from ny DB2 developer. You will come to know exactly which field or value is creating problem.

Regards

Sushil

Former Member
0 Kudos

Hello all,

Thanks for the replies .

My Problem is solved.

As shankar said it was because of the Space and Datatype was not matching on the Target side.

Regards

GangaPrasad