cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC UPDATE_INSERT not working

Former Member
0 Kudos

Hi Experts,

I have an issue with the JDBC Update_Insert action with the SQL database.

When I tried with the Update function and Insert Function seperately the data was updating in the database fine.

When I use the UPDATE_INSERT action with the same data getting below error.

Error while parsing or executing XML-SQL document:
Error processing request in sax parser: Error when executing statement for
table/stored proc. 'CUSTMAST' (structure 'Statement'):
com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be
truncated.

And the query that was running in the background was as follows

10.04.2014 16:34:45InformationJDBC
Adapter Receiver processing started, required QoS ExactlyOnce
10.04.2014 16:34:45InformationJDBC
Adapter Receiver Channel CC_Laserfische_FetchDate:  processing started; party *
/ service SYS_DB_BIS.
10.04.2014 16:34:45InformationUPDATE CUSTMAST SET COMP_CODE='ESSR', CUST_ID='20035780',
CUST_NAME='PRAVEEN', CITY='HYD', PINCODE='500060', COUNTRY='IN',
EMAIL='praveen@essar.com', REC_INSR_DATETIME='2014-04-10 16:34:45' WHERE
(COMP_CODE='ESSR' AND CUST_ID='20035780')
10.04.2014 16:34:45InformationINSERT INTO  CUSTMAST (COMP_CODE, CUST_ID, CUST_NAME, CITY, PINCODE,
COUNTRY, EMAIL, REC_INSR_DATETIME) VALUES ('ESSR', '20035780', 'PRAVEEN', 'HYD',
'500060', 'IN', 'praveen@essar.com', '2014-04-10 16:34:45')

When I try this query manually in the database it is working fine but when I trigger the data from SAP PI 7.1 we are facing error as mentioned above.

Please help me with this.

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Praveen,

Error "String or binary data would be truncated." comes when the incoming data length is more than the length specified in Database.


Cross check the lengths in Database with your data.



Reagrds,

Sudhasree

Former Member
0 Kudos

Yes, I have checked the length of each field in database. I am sending the data which has short length for each field.

When I run the query with the same field lengths manually in the database it is working.

Also When i trigger  the same data using Update action then it is working fine, but not working using UPDATE_INSERT.

0 Kudos

Have you tried INSERT function alone. Is that also working fine.

Former Member
0 Kudos

Strange, actually now Update_Insert is working fine when I create a new channel and triggering the data.

But I have one more concern. when I send multiple records it is not working correctly.

suppose if I send 2 records, 1st is update and 2nd is insert. The data for the first record is updating correctly but 2nd data is not inserting in the database.

Do i need to change any mapping ?

Please help me.

0 Kudos

Are you getting any error when your trying with multiple records.

Former Member
0 Kudos

Hi

make sure you are mapping the row node to statement node in the target .

regards,

Krishna

Harish
Active Contributor
0 Kudos

Hi Praveen,

Please check the below discussion

regards,

Harish