Error ORA-01480 on long bind string.

ShawnP

Member
I am receiving an "ORA-01480: trailing null missing from STR bind value" when inserting a 1800 character string into a VARCHAR2(2000) on a 9i database with the WE8MSWIN1252 UTF-8 character set. Client is 817 on WIN2000 with the WE8ISO8859P1 character set. DOA version 3.4.3.

I believe the problem is originating in the TOracleQuery.BindVariables method with the size of the buffer passed to the OCIBindByName call. The variable lBufSize is set to 1000, (4000 div CharacterSize), but lBuf contains a 1800 character string.

Do you have a workaround for this?

Thanks.

------------------
ShawnP
 
For multi-byte character sets you need to set TOracleSession.BytesPerCharacter to bcAutoDetect.

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
For multi-byte character sets you need to set TOracleSession.BytesPerCharacter to bcAutoDetect.


We already do that. We modified the TOracleSession constructor so it sets FBytesPerCharacter to bcAutoDetect.

------------------
ShawnP
 
I didn't read your message close enough. Apparently you have a 4-byte character set, so 1800 characters is too much.

------------------
Marco Kalter
Allround Automations
 
Hi,

I also have the same problem and the session already set bcAutoDetect. I found it is not related to the length of the field as I increase the length of the field in database from 2000 to 2300 say, the same error occurs.

Any help ?

Current version 3.4.6.1 with D5
Chinese OS but the data key in is just Enlish characters and #D#A

Regards,
Nelson.
 
To further explain,
Currently, it can save upto 1300 English characters + 13 #D#A
for a field of varchar2(2000)

Regards,
Nelson.
 
This would indicate that your NLS_LANG uses a 3 byte character set.

------------------
Marco Kalter
Allround Automations
 
my NLS_LANG is AMERICAN_AMERICA.ZHT16BIG5
How to fix it if I wish to store 2000 chars in addition to some #D#A (line feed) ? Will it exceed the max. length of the SQL string ?

Regards,
Nelson.
 
Back
Top