Quantcast
Channel: SCN: Message List - SAP MaxDB
Viewing all articles
Browse latest Browse all 2539

Re: Parsing error -8 when update-clause used with nextval

$
0
0

Hello Thorsten,

 

guess that's a tough one.

 

Change your setup to

create table "MONA"."PARSEAGAIN"(

"SPALTE_A" CHAR (1) ASCII,

"SPALTE_B" CHAR (1) ASCII,

"SPALTE_C" CHAR (1) ASCII,

"SPALTE_D" CHAR (1) ASCII,

"SPALTE_E" LONG BYTE,                          <-- ONLY CHANGE THIS!

"SPALTE_F" INTEGER)

 

Then feed for example data into the table using the INSERT statement:

 

pStmt = connection.prepareStatement("insert into parseagain (SPALTE_A, SPALTE_B, SPALTE_C, SPALTE_D, SPALTE_E, SPALTE_F) values (?,?,?,?,?,seq_syncid.nextval)");

pStmt.setString(1, "a");

pStmt.setString(2, "b");

pStmt.setString(3, "c");

pStmt.setString(4, "d");

pStmt.setBinaryStream(5, new java.io.ByteArrayInputStream("test".getBytes()),"test".getBytes().length);

pStmt.execute();

 

-> WORKS FINE!

 

NOW TRY THE UPDATE LIKE:

 

pStmt = connection.prepareStatement("update parseagain (SPALTE_A, SPALTE_B, SPALTE_C, SPALTE_D, SPALTE_E, SPALTE_F) values (?,?,?,?,?,seq_syncid.nextval) where (SPALTE_A = 'a')");

pStmt.setString(1, "a");

pStmt.setString(2, "b");

pStmt.setString(3, "c");

pStmt.setString(4, "d");

pStmt.setBinaryStream(5, new java.io.ByteArrayInputStream("test3".getBytes()),"test3".getBytes().length);

                           

pStmt.execute();

 

-> FAIL!!!!

 

So it seems to have a correlation with my LONG BYTE-column OR with the setBinaryStream to set a value.

 

What do you think?

 

Thanks a lot for your time. I highly appreciate that. Are you located in Walldorf? If yes I spend a coffee after this issue is solved cause I live just in the next village. :-)

 

Chris


Viewing all articles
Browse latest Browse all 2539

Trending Articles