Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Row Locking and ODBC
<utlrarunner_at_my-deja.com> wrote in message
news:8bonso$2g0$1_at_nnrp1.deja.com...
> I have a table consisting of a name and a counter
> that I wish to use to generate unique ids. I want
> to use the following sql to lock the row I am
> working on so that another user cannot select the
> row while I am updating the id.
>
> select record_id from sequences where
> sequence_name = 'mytablename' for update of
> record_id;
>
> Sending the sql via sql plus works fine but when I
> send it through ODBC I am getting an ORA-01002
> error which I believe means a fetch across commit
> boundries. What confuses me is that the error I am
> getting back is on the SQLExecute Call.
>
> In attempting to figure it out I tried doing a
> commit on the connection but this did not seem to
> help. I believe that the something in the state of
> the connection is preventing me from locking the
> row.
>
> Grant Hickey
> ghickey_at_northplains.com
> North
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Change your ODBC and/or SQL Net conneciton settings so that Autocommit is set to false.
Commits reset all row leve locks.
Chris Weiss
chris_at_ntralect.com
Received on Mon Mar 27 2000 - 00:00:00 CST