cancel
Showing results for 
Search instead for 
Did you mean: 

PI JDBC Receiver - strange error on simple INSERT

former_member105769
Participant
0 Kudos

Hi

I have a DB2 (AS400) database table with the following definition:

ColumnIndexgetColumnNamegetColumnClassNamegetColumnDisplaySize
1M5LITMjava.lang.String25
2M5MMCUjava.lang.String12
3M5FDTjava.lang.String8
4M5QOPjava.math.BigDecimal17
5M5UOMjava.lang.String2
6M5SRCjava.lang.String4
7M5DCTOjava.lang.String2
8M5URRFjava.lang.String12

I am generating an XML as:

<?xml version="1.0" encoding="UTF-8" ?>

- <ns1:F57492SSL xmlns:ns1="urn:XXXXXXXXXXXXXXX.com:GBL:SNP:Demand">

- <STATEMENT1>

- <TABLENAME ACTION="DELETE">

  <TABLE>UWEUPMQ.F57492SSL3</TABLE>

  </TABLENAME>

  </STATEMENT1>

- <STATEMENT1>

- <TABLENAME ACTION="INSERT">

  <TABLE>UWEUPMQ.F57492SSL3</TABLE>

- <ACCESS>

  <M5LITM>8055951</M5LITM>

  <M5MMCU>99999</M5MMCU>

  <M5FDT>20131101</M5FDT>

  <M5QOP>1</M5QOP>

  <M5UOM>ZZ</M5UOM>

  <M5SRC>ITMI</M5SRC>

  <M5DCTO>FP</M5DCTO>

  <M5URRF>22454</M5URRF>

  </ACCESS>

  </TABLENAME>

  </STATEMENT1>

</ns1:F57492SSL>

The error being returned is:

14.01.2014 16:09:18.038InformationJDBC Adapter Receiver Channel JDBCReceiverF57492SSL3: Processing started; party   / service JDE_Dev
14.01.2014 16:09:18.077InformationDELETE FROM UWEUPMQ.F57492SSL3
14.01.2014 16:09:18.086InformationINSERT INTO  UWEUPMQ.F57492SSL3 (M5LITM, M5MMCU, M5FDT, M5QOP, M5UOM, M5SRC, M5DCTO, M5URRF) VALUES (8055951,        99999, 20131101, 1, ZZ, ITMI, FP,        22454)
14.01.2014 16:09:18.092ErrorUnable to execute statement for table or stored procedure. 'UWEUPMQ.F57492SSL3' (Structure 'STATEMENT1') due to java.sql.SQLException: [SQL0206] Column or global variable ZZ not found.

Can anyone help please?

Regards

Steve

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

Hi Stephen - is "UWEUPMQ.F57492SSL3" the actual table name or you have mentioned the schema(UWEUPMQ) in it?

If UWEUPMQ is a schema then can you try giving it in the channel insetad of giving it in the table name mapping? in connection string after the DBname just /schema.

former_member105769
Participant
0 Kudos

Hi.  Because this is a AS400 DB2 table, the SQL needs to reference the AS400 Library and the Tablename.

UWEUPMQ is the AS400 Library

F57492SSL3 is the Tablename.

As per my reply above, the following works fine in a SQL client, outside of PI.

INSERT INTO  UWEUPMQ.F57492SSL3 (M5LITM, M5MMCU, M5FDT, M5QOP, M5UOM, M5SRC, M5DCTO, M5URRF) VALUES (8055951,        99999, 20131101, 1, 'ZZ', 'ITMI', 'FP',        22454)

former_member184720
Active Contributor
0 Kudos

Hi Steve - May be you can add the attriubte "hasQuot" for the fields where you need a quote..

former_member105769
Participant
0 Kudos

Thanks.  I've never had to do this before, but it works.  Cheers. 

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bentley,

Try passing a different value to field M5UOM other than ZZ and see.

Regards,

Pranav

former_member105769
Participant
0 Kudos

Hi.  M5UOM originally had a different value.  I set it to a constant of 'ZZ'  to see if that would solve the problem, but it didnt. 
What is interesting is, if I run the following SQL statement directly on the database in a SQL client:

INSERT INTO  UWEUPMQ.F57492SSL3 (M5LITM, M5MMCU, M5FDT, M5QOP, M5UOM, M5SRC, M5DCTO, M5URRF) VALUES (8055951,        99999, 20131101, 1, ZZ, ITMI, FP,        22454)

I get the exact same error

If I change it in the SQL client to

INSERT INTO  UWEUPMQ.F57492SSL3 (M5LITM, M5MMCU, M5FDT, M5QOP, M5UOM, M5SRC, M5DCTO, M5URRF) VALUES (8055951,        99999, 20131101, 1, 'ZZ', 'ITMI', 'FP',        22454)

it works.

It seems that the JDBC adapter is not recognising the fact that some of the fields are Strings, and is treating all fields at numerics.