PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Extract on ODBC Sql Server  (Read 2006 times)

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 175
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Extract on ODBC Sql Server
« 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

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Extract on ODBC Sql Server
« Reply #1 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?
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: Extract on ODBC Sql Server
« Reply #2 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.
Principal Software Engineer for PVX Plus Technologies LTD.

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 175
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Re: Extract on ODBC Sql Server
« Reply #3 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