ORA-01480 problem

R

ravi

Hello,

I have the following piece of code in my server written in
C++ (CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-12 2002/12/16)
ProC++ (Pro*C/C++: Release 8.1.7.4.0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RWCString tmp = "";
EXEC SQL BEGIN DECLARE SECTION;
char dbColValue[10];
short tmpnumber;

short tmpnumberInd;
short dbColValueInd;
EXEC SQL END DECLARE SECTION;

select Column1 into :dbColValue:dbColValueInd from Table1;

if (dbColValueInd == -1)
tmp = "";
else
tmp = RWCString(dbColValue).strip();

strcpy(dbColValue,tmp);

select 1 into :tmpnumber:tmpnumberInd from Table2 where Column2 =
:dbColValue;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am getting intermittent ORA-1480 (Bind value not terminated by null)
error. A similar piece of code is working fine elsewhere. Cant find a
mistake in the code. Also, I am not able to replicate this error, but
is occurring intermittently.

Any help/ideas is highly appreciated.

Regards,
Ravi.
 
M

Michael Ashton

ravi said:
Hello,

I have the following piece of code in my server written in
C++ (CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-12 2002/12/16)
ProC++ (Pro*C/C++: Release 8.1.7.4.0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RWCString tmp = "";
EXEC SQL BEGIN DECLARE SECTION;
char dbColValue[10];
short tmpnumber;

short tmpnumberInd;
short dbColValueInd;
EXEC SQL END DECLARE SECTION;

select Column1 into :dbColValue:dbColValueInd from Table1;

if (dbColValueInd == -1)
tmp = "";
else
tmp = RWCString(dbColValue).strip();

strcpy(dbColValue,tmp);

select 1 into :tmpnumber:tmpnumberInd from Table2 where Column2 =
:dbColValue;

If that's C++, you need to cut back on the macros. --mpa
 
S

Salt_Peter

ravi said:
Hello,

I have the following piece of code in my server written in
C++ (CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-12 2002/12/16)
ProC++ (Pro*C/C++: Release 8.1.7.4.0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RWCString tmp = "";
EXEC SQL BEGIN DECLARE SECTION;
char dbColValue[10];
short tmpnumber;

short tmpnumberInd;
short dbColValueInd;
EXEC SQL END DECLARE SECTION;

select Column1 into :dbColValue:dbColValueInd from Table1;

if (dbColValueInd == -1)
tmp = "";
else
tmp = RWCString(dbColValue).strip();

strcpy(dbColValue,tmp);

select 1 into :tmpnumber:tmpnumberInd from Table2 where Column2 =
:dbColValue;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am getting intermittent ORA-1480 (Bind value not terminated by null)
error. A similar piece of code is working fine elsewhere. Cant find a
mistake in the code. Also, I am not able to replicate this error, but
is occurring intermittently.

Any help/ideas is highly appreciated.

Regards,
Ravi.

Take your issue to ORA's forums, this has got nothing to do with C++.
There is no such thing as a RWCString either (whatever that is).
 
R

ravi

If that's C++, you need to cut back on the macros. --mpa

Could you please elaborate on what you mean by macros? Thanks.
My guess is that strcy(oracle_char_var,RWCString) is not working
properly.
Both are structures and not char *. I am not sure if the implicit cast
is working properly.
Also, I am not sure if it is the best way to copy the information. Unit
testing this part alone produced proper results without any anomalies.

The frustrating part is that it is intermittent and hence finding it
extremely hard to replicate. Any ideas for replication are also
appreciated.

Do you see any memory leakage problems with the code?

Ravi.
 
R

ravi

Salt_Peter said:
Take your issue to ORA's forums, this has got nothing to do with C++.
There is no such thing as a RWCString either (whatever that is).

Thanks for the suggestion. I have posted the query in oracle forum
also.
btw, RWCString a Rogue Wave String class for C++. Google for it for
more information.
Thanks again !

Regards,
Ravi
 
M

Michiel.Salters

ravi schreef:
Thanks for the suggestion. I have posted the query in oracle forum
also.
btw, RWCString a Rogue Wave String class for C++.

There are quite a few string classes for C++, but there is only one C++
(ok, there's a 2003 service pack :) )
Hence, in comp.lang.c++ we don't know all string classes, but I bet
Rogue Wave is familiar with C++ if they're writing C++ classes. So if
your question is about RW products in combination with C++, the
best place is to ask RW. If with Oracle, ask Oracle, etc.

HTH,
Michiel Salters
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top