[unixODBC-support] unixODBC with FreeTDS on SQL Server
LHT at DISC.com
Mon Jun 25 23:04:28 BST 2007
I have a legacy application that has always worked with ODBC and MS
SQLServer on Windows as well as Postgres and Oracle. I'm trying to port
to Linux and use unixODBC with FreeTDS for SQL Server. My only current
problem is updates and deletes. I can't seem to get my cursor to change
to SQL_CONCUR_LOCK or allow FOR UPDATE.
My HDBC handle is READ WRITE.
I try to do
SQLSetStmtOption(CONCURRENCY)=CONCUR_LOCK hstmt=685790 hdbc=6715c0
henv=5928b0 was successful
Error: hstmt=685790 hdbc=6715c0 henv=5928b0 sql_error=1
SQL Warning: ReturnCode: 1, Error: 0, State: 01S02:
[unixODBC][FreeTDS][SQL Server]Option value changed
Then when I do a prepare for an positioned update I get an error.
SQLSetCursorName() = DAODB00001 was successful
SQL[SELECT PRODUCT_NO, DESCRIPTION, DIVISION, DEPT, CATEGORY\
>>, MFR, MARGIN, WHOLESALE, COST, ((WHOLESALE*100.0)/COST) FROM PRODUCTS
>> PRODUCT_NO IN (?) FOR UPDATE]
SQLPrepare (hstmt=685790 hdbc=6715c0)
ERROR: hstmt=685790 hdbc=6715c0 henv=5928b0 sql_error=-1
Error=1003, State=37000 Buffer=[unixODBC][FreeTDS][SQL Server]
Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.
Is there an option in the DSN that allows this to happen. I have looked
at many examples, and I can't see that I'm doing anything wrong.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the unixODBC-support