cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Receiver error INSERT action

harish_babu5
Participant
0 Kudos

HI

My scenario is from ECC to MS SQL. I am doing an INSERT in the table. When I run the scenario, I am getting this error:

Error when executing statement for table/stored proc. 'Employee' (structure 'Statement'): com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated

Employee is my Table Name and I have seventy odd fields in the interface

I have maped the action as INSERT

I have few date fields in the ms sql table. I am sending data in this format YYYY-MM-DD HH:MM:SS      But when I imported th metadata of the SQL table to the PO server, I saw that these date fields are marked TIMESTAMP length = 16. Is that why I am getting error?

Regards

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member183908
Active Contributor
0 Kudos

as mentioned by stefan current error is not becuase of this however try using the datatype as per below screen shot in sql. i am able to insert YYYY-MM-DD HH:MM:SS without any issues.

Thanks

harish_babu5
Participant
0 Kudos

I tried that and I am still getting the same error

It's not due to arabic letters. I am getting that error even when they are not therer

iaki_vila
Active Contributor
0 Kudos

Hi Harish,

As Stefan pointed out you are probably setting a value with more characters that the field support (String or binary data would be truncated. - SQL Server Performance).

Kindly try to talk with your DB team to check what is the maximum length of all the fields inside employee table; and if it is possible they give you a successful SQL INSERT sentence that you can use to compare with your request.

Regards.

stefan_grube
Active Contributor
0 Kudos

I have few date fields in the ms sql table. I am sending data in this format YYYY-MM-DD HH:MM:SS      But when I imported th metadata of the SQL table to the PO server, I saw that these date fields are marked TIMESTAMP length = 16. Is that why I am getting error?

No, this is not the cause of your error, as the error message would be different.

You have to go through all fields and check the valid length. You could create a user defined function that restricts the length of the fields.

harish_babu5
Participant
0 Kudos

HI Stefan

There are two Arabic fields. The field values are appearing in the target payload also. I have given them as string. Could they be the reason?

I checked all seventy fields and all have characters less than the one we are sending.

Since I am not usinng UPDATE_INSERT, I didn't use Key also

vishnu_pallamreddy
Contributor
0 Kudos

Hi Harish,

The issue may be with the data types.

As in the Table that data type and length for each fields are mentioned and the source value that is getting into the JDBC table are not in synch, hence this error.

The error for truncation is because of the length of the field value.

Suggest you to check with the DB team and give them the list of all field values and ask them to enter it in the table. This way it will be easier to see if these are the error possibilities.

former_member183908
Active Contributor
0 Kudos

can you please check below notes i had an issue in inserting Chinese characters in PI 711 some time back

SAP Note 102402 - Changing the database character set

SAP Note 456968 - Changing Database Character set - Valid

SAP Note 606359 - FAQ: Oracle National Language Support

SAP Note 831162 - FAQ: XI 3.0 / PI 7.0 / PI 7.1 / PI 7.3

Thanks

Former Member
0 Kudos

1>>>

//

I have few date fields in the ms sql table. I am sending data in this format YYYY-MM-DD HH:MM:SS      But when I imported th metadata of the SQL table to the PO server, I saw that these date fields are marked TIMESTAMP length = 16. Is that why I am getting error?

//


If it would be the case, then you should have received something like "Conversion which resulted in an out of range datetime value ".

2>>

//

There are two Arabic fields. The field values are appearing in the target payload also. I have given them as string. Could they be the reason?

//

Can you shared the resulted target payload. Can happen the structure generated after mapping is violating the one expected by the SQL.

Regards, Sujit