Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Error in RELEASE mode only

Status
Not open for further replies.

CMR

Programmer
Apr 30, 2002
76
AU
Hi all

I'm executing a prepared SQL statement from within my code which is working quite happily in debug mode but fails in release mode.
In my statement, I'm binding both columns and parameters then executing it repeatedly with different parameter values each time.
This all work fine in debug but I get "String data, right truncated" (SQLState 22001) when I run it in release mode. as far as I can tell, all the buffers I'm allocating and binding to the columns/parameters are big enough and I've established that the error is being returned by SQLExecute(), so I'm not even getting the chance to set the parameter values anyway.
I guess I'm not initialising something or other (this is the usual cause of things working in debug but not release, in my experience) so I'm afraid I've run out of ideas.

Any thoughts?

thanks in advance for any help.

CMR
 
there could be also something like you pass too big parameters to your SQL. It is enough you to pass the parameter as big however it is small. It looks like everithing is ok, but only in debug mode because this mode is often more tolerant. Ion Filipski
1c.bmp


filipski@excite.com
 
Thanks for the reply

I managed to fix the problem - it was my silly mistake.

One of the buffers I had allocated when I called SQLPrepare() was a local variable when it should have been global as I was calling SQLExecute() in a different function.

It's always the simple problems like this that are the most frustrating...

CMR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top