Print Thread
Page 1 of 5 1 2 3 4 5
ora-01480
#37448 03/02/10 10:11 AM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
One of our customer reports: Ora-01480 - Trailing null missing from STR bind value. (Ora10 database, delphi7, doa 4.0.6.2)

It happens on a update from a normal oracledataset. The size of the field in de database en tstringfield is 2000. The length of the string being inserterd is approximatly 1100 characters. What could be the problem?

Oracle monitor query generated:
update AROOSTERPLOEG
set ARP_DIENSTEN = :v1
where rowid = :doa__rowid
returning rowid into :doa__rowid

Re: ora-01480
Ruudbern #37449 03/02/10 10:48 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
Can you let me know the character set of the database? The problem is probably related to that.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #37451 03/02/10 12:02 PM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
It seems the problem occurs at the sizes above 1000 characters. Th eprogram tries to store a string of 1001 characters.

During the import of their dump it say's:
import is uitgevoerd in WE8MSWIN1252 tekenset en AL16UTF16 NCHAR-tekenset.
importserver gebruikt WE8ISO8859P15 tekenset (mogelijke tekensetconversie).



Re: ora-01480
Ruudbern #37455 03/02/10 03:06 PM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
I have send queries to that customer to get the info from their database: 'NLS_CHARACTERSET' and 'NLS_NCHAR_CHARACTERSET';


Re: ora-01480
Ruudbern #37463 03/03/10 12:11 PM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
Hi Marco,

The database nls_database_parameters returns:
'NLS_CHARACTERSET' = AL32UTF8
'NLS_NCHAR_CHARACTERSET' = AL16UTF16

is this enough info for you?

thnx in advance
Ruud



Last edited by Ruudbern; 03/04/10 07:11 AM.
Re: ora-01480
Ruudbern #37473 03/04/10 10:21 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
Thanks. Have you set TOracleSession.BytesPerCharacter to bcAutoDetect? This is required for multi-byte character set databases.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #37480 03/04/10 12:08 PM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
Yes, the BytesPerCharacter property was allready set to bcAutoDetect.

Last edited by Ruudbern; 03/04/10 12:39 PM.
Re: ora-01480
Ruudbern #37493 03/05/10 12:26 PM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
I see now that you are using 4.0.6 on a Unicode database. For Unicode support you will need to upgrade to version 4.1.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #37537 03/09/10 07:10 AM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
Hello Marco,

thanks for your quick reply's

regards Ruud


Re: ora-01480
Ruudbern #37632 03/18/10 01:29 PM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
Hello Marco,

We wrote a testprogram using the 4.1.0 trial but the problem remains the same.

Regards Ruud

Re: ora-01480
Ruudbern #37641 03/19/10 10:29 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
Just to be sure: have you set TOracleSession.BytesPerCharacter to bcAutoDetect?


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #37685 03/23/10 07:18 PM
Joined: Mar 2005
Posts: 2
Tokyo, Japan
Member
Offline
Member
Joined: Mar 2005
Posts: 2
Tokyo, Japan
Hello, Marco,
Since some DOA users in JAPAN reported this same ORA-01480 error,
I'm currently investigating this with a small sample program.

With Server:
NLS_CHARACTERSET AL32UTF8
NLS_LENGTH_SEMANTICS BYTE
and Client:
NLS_LANG=JAPANESE_JAPAN.JA16SJISTILDE

I get ORA-01480 when I update a
VARCHAR2 (2020) column with a long (l>=1001) string.

BytesPerCharacter = 4,
MaxVarChar = 4000 / 4 = 1000.
----------
I've found that Session.MaxVarChar is so small that
TOracleQuery.BindVariables truncates the buffer too short.
----------
There seems to be a workaround.

function TOracleSession.MaxVarchar: Integer;
begin
if UseOCI80 then Result := 4000 else Result := 2000;
Result := Result div CharacterSize;
Result := 16000; //<< HERE is the worlkaround.
end;

By setting the MaxVarchar large enough,
DOA won't truncate the input varchar2 string any more.

But I'm not sure it is safe to do so yet.

Is this safe to set MaxVarchar = 160000 so that
it's large enough for VARCHAR2(4000 CHAR ) in AL32UTF8 ?

I hope the only bad thing with MaxVarchar=16000 is
larger memory consumption smile

Re: ora-01480
Kunikazu Okada #37688 03/24/10 10:32 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
Thanks, we'll check it out.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #37710 03/26/10 02:09 PM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
Yes the TOracleSession.BytesPerCharacter = bcAutoDetect.
I wil make a test program to check the workaround Kunikazu suggests. (thanks in advance for sharing this.)

Marco can you let me know if this is save to use?

Re: ora-01480
Ruudbern #37714 03/29/10 09:57 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
I cannot yet say if it is safe. We have not yet tested this.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #37730 04/01/10 06:03 AM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
Hi Marco,

the workaround from Kunikazu does the trick. When can we expect an answer if it is ok to use in an productional environment.

thanks in advance

Ruud

Re: ora-01480
Ruudbern #37734 04/01/10 09:32 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
I'm not sure yet. This will require some extensive testing.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #37736 04/01/10 09:41 AM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
Ok I understand,

i have to be more patient then "Szell" the dentist in "The Marathon man" ... "is it safe?" ;-)

kind regards

Re: ora-01480
Ruudbern #38995 11/04/10 12:27 PM
Joined: May 2001
Posts: 53
Enschede, The Netherlands
F
Member
Offline
Member
F
Joined: May 2001
Posts: 53
Enschede, The Netherlands
Has this issue been resolved yet?


Frans
Re: ora-01480
F.Hinlopen #39146 12/08/10 11:22 AM
Joined: Jun 2005
Posts: 37
Norway
A
Member
Offline
Member
A
Joined: Jun 2005
Posts: 37
Norway
We are facing the same issue - what is the status of this issue?
Can we expect a fix in the soon future?

Re: ora-01480
Marco Kalter #39356 01/26/11 06:52 PM
Joined: Feb 2005
Posts: 49
A
Member
Offline
Member
A
Joined: Feb 2005
Posts: 49
I have the same problem. I use Oracle.NoUnicodeSupport:=True.
Using DOA 4.1.2.0, Delphi 2010.
Is it fixed now?

Re: ora-01480
Alberto Pilat #39362 01/27/11 10:00 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
We do not yet have a fix for this, but we are working on it.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #39617 03/03/11 11:12 AM
Joined: Feb 2005
Posts: 49
A
Member
Offline
Member
A
Joined: Feb 2005
Posts: 49
Hi Marco,
I see that patch 4.1.2.2 is available, we're still using 4.1.2.0.
Is this problem fixed? Thanks

Alberto Pilat

Re: ora-01480
Alberto Pilat #39626 03/04/11 10:47 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
We may have a fix. I will upload a Delphi 2010 version shortly and will post a link here.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #39635 03/04/11 02:58 PM
Joined: Feb 2005
Posts: 49
A
Member
Offline
Member
A
Joined: Feb 2005
Posts: 49
Very thanks, I'll wait for it
Alberto Pilat

Re: ora-01480
Alberto Pilat #39734 03/18/11 04:25 PM
Joined: Feb 2005
Posts: 49
A
Member
Offline
Member
A
Joined: Feb 2005
Posts: 49
Hi Marko,
some news about the problem? Thanks

Re: ora-01480
Alberto Pilat #39737 03/21/11 11:02 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
We need to do some last tests, but I can upload a test version this week.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #39982 04/21/11 07:22 AM
Joined: Feb 2005
Posts: 49
A
Member
Offline
Member
A
Joined: Feb 2005
Posts: 49
Recently was post a fix in 4.1.2.2. Is this the test version that you write about?
Alberto Pilat

Re: ora-01480
Alberto Pilat #41174 06/23/11 02:54 PM
Joined: Feb 2005
Posts: 49
A
Member
Offline
Member
A
Joined: Feb 2005
Posts: 49
Sorry Marco, but now the problem is getting urgent.
How long we have to wait yet?
Alberto

Re: ora-01480
Alberto Pilat #41185 06/24/11 10:01 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
Not long. If you have the source code option I can already send you the source changes by e-mail.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #41251 06/29/11 09:26 AM
Joined: Feb 2005
Posts: 49
A
Member
Offline
Member
A
Joined: Feb 2005
Posts: 49
Thanks, unfortunatly I haven't source code option, but it's enough to know the month when the fixed will be available. You can understand that we have to tell something to our customers...
I can wait but I pray you to tell me a date.
Bye
Alberto

Re: ora-01480
Alberto Pilat #41493 07/13/11 08:37 AM
Joined: Feb 2005
Posts: 49
A
Member
Offline
Member
A
Joined: Feb 2005
Posts: 49
Marco, what I have to do to enable the source code option? Can you post me the correction as you've said?

Re: ora-01480
Alberto Pilat #42898 12/09/11 01:29 AM
Joined: Jul 2011
Posts: 5
C
Member
Offline
Member
C
Joined: Jul 2011
Posts: 5
Is this resolved yet? Need a solution if possible. Will start looking for a work around in the meantime.

Re: ora-01480
Cory Jay #42904 12/09/11 10:09 AM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
Version 4.1.3 will be available shortly.


Marco Kalter
Allround Automations
Re: ora-01480
Marco Kalter #43581 03/14/12 09:43 PM
Joined: Jul 2011
Posts: 5
C
Member
Offline
Member
C
Joined: Jul 2011
Posts: 5
It appears to me that 4.1.3 is still not available for XE (I did a new download from the registered page and the unpacked files are names *412.*. Is this issue resolved in the XE2 versions of the components? Is there any other way that I can get around this limitation?

Re: ora-01480
Arvid #43734 04/11/12 09:25 AM
Joined: Jul 2002
Posts: 71
R
Member
OP Offline
Member
R
Joined: Jul 2002
Posts: 71
Hi Marco,

we bought the last doa version and i expected this issue would be solved. We are using delphi7 and doa version 4.1.1 (Highest version available for delphi 7) We still get the trailing null error....

any suggestions?

Regards Ruud

Last edited by Ruudbern; 04/12/12 08:18 AM.
Re: ora-01480
Ruudbern #44006 05/30/12 11:30 AM
Joined: May 2012
Posts: 1
H
Member
Offline
Member
H
Joined: May 2012
Posts: 1
Hi,

We have Delphi XE2 and DOA 4.1.3, and still getting this
"ora-01480" error. Is there a fix ready soon, or does anyone have another workaround? We do not have the source-code.

Regards,
Heimsater

Re: ora-01480
Heimsater #44117 06/20/12 01:31 PM
Joined: Jun 2012
Posts: 1
S
Member
Offline
Member
S
Joined: Jun 2012
Posts: 1
Hi.
I wonder why a fix is still not availabale when this bug is known for over a year now. It is not that difficult to fix it. Look into TOracleQuery.BindVariables procedure located in in Oracle.pas We need this piece of code:
// Determine the maximum number of characters for a string or char variable
lBufSize := bufsize;
if (lBufType in [otString, otChar, otVarchar2]) and (BufType <> otPLSQLString) then
begin
if CharSetForm = ocfNational then
begin
if (lBufSize > Session.MaxVarcharN + 1) then lBufSize := Session.MaxVarcharN + 1;
end else
if (lBufSize > Session.MaxVarchar + 1) then lBufSize := Session.MaxVarchar + 1;
end;

It calculates buffer size of the string bind variable. Problem is, calculation is done in CHARACTERS when it needs to be in BYTES. Here is fixed version:
// Determine the maximum number of characters for a string or char variable
lBufSize := bufsize;
if (lBufType in [otString, otChar, otVarchar2]) and (BufType <> otPLSQLString) then
begin
//Buffer size must be calculated in bytes, not in characters!
if CharSetForm = ocfNational then
begin
if (lBufSize > Session.MaxVarcharN * Session.CurrentBytesPerNCharacter + 1) then
lBufSize := Session.MaxVarcharN * Session.CurrentBytesPerNCharacter + 1;
end else
if (lBufSize > Session.MaxVarchar * Session.CurrentBytesPerCharacter + 1) then
lBufSize := Session.MaxVarchar * Session.CurrentBytesPerCharacter + 1;
end;

Just copy+paste it instead of the old block, roll out a new version of DOA and everybody will be happy.

Re: ora-01480
snowmann #46040 02/12/13 12:01 PM
Joined: Feb 2005
Posts: 49
A
Member
Offline
Member
A
Joined: Feb 2005
Posts: 49
Hello,
what about this bug? I receive ora-01480 when I try with DXE3 + DOA 4.1.3.3 against a Oracle 9.2.
I use bind string variables, while if I use subst variables or build the entire statement it works.
Also, if I execute the same statement in PL/SQL using same string variables it works.
Thanks.

Re: ora-01480
Ruudbern #46122 02/15/13 04:22 PM
Joined: Feb 2005
Posts: 49
A
Member
Offline
Member
A
Joined: Feb 2005
Posts: 49
Sorry, but it was my mistake...I see now that I was using oci7 compatibility!
Without its, it works.

Re: ora-01480
Marco Kalter #46935 04/26/13 02:34 PM
Joined: Apr 2013
Posts: 2
H
Member
Offline
Member
H
Joined: Apr 2013
Posts: 2
Hi Marco,

wie use CBuilder-2009 and we do not have the source-code.
So what can we do to solve the problem?
The post from snowmann looks like a working solution, why can't we get a fix for the bug?

>> Just copy+paste it instead of the old block, roll out a new version of DOA and everybody will be happy.

Thanks

Page 1 of 5 1 2 3 4 5

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.147s Queries: 14 (0.097s) Memory: 2.7112 MB (Peak: 3.2000 MB) Data Comp: Off Server Time: 2024-05-06 04:03:05 UTC
Valid HTML 5 and Valid CSS