Skip to Content.
Sympa Menu

freetds - [freetds] ODBC: SQLPrepare + repeated SQLExecute working?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Craig Davison <cd AT securityfocus.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] ODBC: SQLPrepare + repeated SQLExecute working?
  • Date: Sun, 16 Feb 2003 16:33:13 -0700

Hi,

Should prepared statements be working in the ODBC driver? I'm asking because
I think I may
have found another bug in the driver, but I'll spare you all yet another test
program until
I can determine that it's not working as advertised.

Basically, this is what I'm doing in pseudocode:

SQLBindParameter gid
SQLBindCol uid
SQLPrepare "SELECT gid FROM master..sysusers WHERE uid=?"
for uid=0 to 100
{
SQLExecute
if SQLFetch != SQL_NO_DATA
print "gid is %d for uid %d", gid, uid
}

But it fails at the second iteration of the loop:
SELECT gid FROM master..sysusers WHERE uid=0
gid is 0 for uid 0
SELECT gid FROM master..sysusers WHERE uid=1
Error query -1
[unixODBC][Driver Manager]Invalid cursor state (0)

Am I trying something that isn't implemented yet? Does anyone know what
'Invalid cursor state'
means in a case like this?

Thanks again.
My server is MS SQLserver 2k; my client is FreeTDS 0.61rc1 CVS from Friday on
RedHat 8 x86.
I'm using unixODBC 2.2.2.

--
Craig Davison
Symantec Corporation
+1 (403) 213-3939 ext. 228




Archive powered by MHonArc 2.6.24.

Top of Page