1. Andrew Davis
  2. PowerBuilder
  3. Thursday, 27 June 2019 12:14 PM UTC

Hi

I am trying to insert some data to my database and I am getting a right truncation error - so i turned of the error checking for the erros . The data has many international characters in it.

I now get a primary key exists because the data is truncated

This is what i am doing

ls_name=dw_1.getitemstring(ll_loop,"name")

// then selecting the database to see if it exists

select ...... where "name"=:ls_name

// i get the the result - not found on database

so it insert

insert....name=:ls_name

// i get an error saying the record already exists 

So  

Is there a way of checking what the database will truncate the data to and then truncate it in powerscript ?

 

thanks

 

Anderw

David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Thursday, 27 June 2019 15:32 PM UTC
  2. PowerBuilder
  3. # 1

Hi Andrew

So to be clear when you do the getitemstring you get the complete string value, but the insert is truncating this in the DB.

If that's the case it sound like the DB column size is too small. If so you should change the DW column size to match.

If that's not the case can you give details of the column in the DB as the DW properties?

Thanks

David

Comment
  1. John Fauss
  2. Thursday, 27 June 2019 17:59 PM UTC
It would be helpful to know which database server, which PB database driver, and PB version you are using, Andrew.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.