Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / February 2006

Tip: Looking for answers? Try searching our database.

SQL0072 ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shorti - 01 Feb 2006 16:38 GMT
Does anyone have a definition for this.  I do not see it in any of the
references including the DB2 Info Center website.  I am getting this
after a declare cursor.  I am not sure what the problem is unless I
know what the error means.

BTW...72 is positive. Running v8.2.2
Knut Stolze - 01 Feb 2006 17:43 GMT
> Does anyone have a definition for this.  I do not see it in any of the
> references including the DB2 Info Center website.  I am getting this
> after a declare cursor.  I am not sure what the problem is unless I
> know what the error means.

Could you possibly provide us with the complete error message?  A SQL0072
does not exist and should not be returned by DB2.  So either something is
wrong in DB2 or some sort of application you are running interferes.

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

shorti - 01 Feb 2006 19:07 GMT
hmm...I was hoping it was just a missed sqlcode.  I dont think you are
going to be able to determine much by the info I have.  This is just
what is being logged from sqlca.sqlcode after statement:

EXEC SQL
  DECLARE c1 CURSOR FOR stmt;

sprintf(logstr, "Error from DECLARE, SQLCODE %d ",
(short)sqlca.sqlcode);

the logs says:
2006.02-01.10:14:14.681992 c0v0 XDB Error from DECLARE, SQLCODE 72

Just after logging it does a: if (sqlca.sqlcode == 0){
it does not go in here so I know it is returning a non-zero sqlcode.
The logging has always been correct in the past so I have reason to
believe it is correct.

There is nothing between the EXEC, sprintf and the 'if'.  logstr is
also plenty long enough.

I will have to try using the debugger on it to see if the memory space
is being overwritten by something else running or if db2 is, in fact,
sending back a 72.  This is currently being run on a test machine where
there is very little running.
Jan M. Nelken - 01 Feb 2006 23:29 GMT
> EXEC SQL
>    DECLARE c1 CURSOR FOR stmt;
>
> sprintf(logstr, "Error from DECLARE, SQLCODE %d ",
> (short)sqlca.sqlcode);

sqlcode is defined as sqlint32 - why are you truncating this field to 16 bits?

Jan M. Nelken
shorti - 02 Feb 2006 14:24 GMT
The sqlcode is 72 regardless of the truncation.
Knut Stolze - 02 Feb 2006 16:41 GMT
> hmm...I was hoping it was just a missed sqlcode.  I dont think you are
> going to be able to determine much by the info I have.  This is just
[quoted text clipped - 5 lines]
> sprintf(logstr, "Error from DECLARE, SQLCODE %d ",
> (short)sqlca.sqlcode);

You should fix this line.
(1) %d expects an "int" value, not a short (gcc will complain about this
rightfully if you have -Wall turned on).
(2) you should truncate the sqlcode in the first place.

You are right, the truncation is not a problem _today_ as the largest
absolute sqlcode in DB2 is -30108.

> the logs says:
> 2006.02-01.10:14:14.681992 c0v0 XDB Error from DECLARE, SQLCODE 72

There is obviously a but more to the "logging" than you have shown us.
Could you possibly provide some more code?

> There is nothing between the EXEC, sprintf and the 'if'.  logstr is
> also plenty long enough.

You could collect a DB2 trace as you will see the complete SQLCA structure
in there.

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

Knut Stolze - 02 Feb 2006 16:53 GMT
> (2) you should truncate the sqlcode in the first place.

should not!!

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.