Please help: SQL ERROR: -243
Posted in 1999
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
I've written a program in ESQL/C (my first) that reads through a table and dumps it to an ascii file. Most of the time I works just fine, however occasionally I get this error: SQL ERROR: -243 Could not position within a table (%s). ISAM ERROR: -144 ISAM error: key value locked Another process is concurrently accessing the table. From my reading it looks like I will have to issue a "SET ISOLATION" and/or "SET LOCK MODE" in my program. This raises two issues: (1) I'm not sure which of these options are the best for my situation (or how to tell), (2) I have no control of the other process that is accessing the database, so I'm assuming that will effect which options to set. Thanks in advance. All/any help is greatly appreciated :-) - Randy Galbraith Bulk mailers please note: UCE/Spam is not welcome at my inbox.
Randy Galbraith wrote:
>
> I've written a program in ESQL/C (my first) that reads through a table
> and dumps it to an ascii file. Most of the time I works just fine,
> however occasionally I get this error:
>
> SQL ERROR: -243 Could not position within a table (%s).
>
> ISAM ERROR: -144 ISAM error: key value locked
>
> Another process is concurrently accessing the table. From my reading it
> looks like I will have to issue a "SET ISOLATION" and/or "SET LOCK MODE"
> in my program. This raises two issues: (1) I'm not sure which of these
> options are the best for my situation (or how to tell), (2) I have no
> control of the other process that is accessing the database, so I'm
> assuming that will effect which options to set.
SET ISOLATION DIRTY READ will work but you may be dumping rows thatwill be rolled back later. Better to use SET LOCK MODE TO WAIT n.
Art S. Kagel