PxPlus User Forum

Main Board => Discussions => ODBC => Topic started by: Jeffrey Ferreira on August 22, 2018, 02:45:52 PM

Title: Extract on ODBC Sql Server
Post by: Jeffrey Ferreira on August 22, 2018, 02:45:52 PM
I was opening up a MS SQL Server table with [ODB].
Out of habit I tried to do an extract before writing a record and I received the following error:
msg(-1) = for update clause allowed only for declare cursor.
Does anyone have any idea what this is?
I ended up just doing a read/write and that worked.
Should I not bother with EXTRACTS on [ODB]SQL
Title: Re: Extract on ODBC Sql Server
Post by: Mike King on August 22, 2018, 02:58:23 PM
What are your [ODBC] configuration settings in the system INI file and what options do you have in the OPEN for the connection?
Title: Re: Extract on ODBC Sql Server
Post by: Devon Austen on August 22, 2018, 03:10:02 PM
Likely you need "CONCURRENCY=LOCK" and "EXTROPT=(UPDLOCK)" in the open options or in the [ODBC] INI section. You can put it in the INI if all of your ODB opens will be to a MS SQL db if not use the open options on the [odb] open to the MS SQL db.
Title: Re: Extract on ODBC Sql Server
Post by: Jeffrey Ferreira on August 22, 2018, 03:24:46 PM
Devon,

I'm sorry I was just about to update my post.
A co-worker had me add:

[ODBC]
NONULLS=P
EXTROPT=$ FOR UPDATE

into the ini file and it works now.

jeff