Re: intermittent ORA-1480 with proc++ code
Date: Fri, 22 Dec 2006 05:43:58 +0000
Message-ID: <6rQZVIVeC3iFFwLk_at_jimsmith.demon.co.uk>
In message <1166757718.071527.50240_at_73g2000cwn.googlegroups.com>,
v.r.sankar_at_gmail.com writes
>
>> >>"Column1 is 9 characters in length. VARCHAR2(9)."
>> Wrong. Column1 is 9 BYTES length. Depending on the characterset you can
>> find strings with 9 letters which are longer than 9 bytes! Try DUMP()
>> function.
>>
>> HTH.
>>
>> Cheers.
>>
>> Carlos.
>
>Good point ! I never thought of it !! But strangely, the code is
>breaking when the Column1 is null, not when it has 9 letter data !!!
>
That means the problem could be here.
if (dbColValueInd == -1)
tmp = "";
else
tmp = RWCString(dbColValue).strip();
If Column1 is null, the dbCalValueInd will be -1 and 'tmp=""' will be executed. What is in tmp after this? Do you need to cast the empty string to RWCString when you assign it?
If you want to use a null value in a query or update, you should use an indicator and set it to -1;
e.g.
insert into tables values (:dbColValue:dbColValueInd);
-- Jim Smith Ponder Stibbons Limited <http://oracleandting.blogspot.com/> RSS <http://oracleandting.blogspot.com/atom.xml>Received on Fri Dec 22 2006 - 06:43:58 CET