Home » SQL & PL/SQL » SQL & PL/SQL » advice on lock
advice on lock [message #38124] Fri, 22 March 2002 05:42 Go to next message
MarcoC
Messages: 10
Registered: February 2002
Junior Member
Hi all,

1)I am using oracle 8i and I have a procedure which is using the following code:

VCURSOR:=DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(VCURSOR, p_stmt, DBMS_SQL.V7);
NROWS:=DBMS_SQL.EXECUTE(VCURSOR);
DBMS_SQL.CLOSE_CURSOR(VCURSOR);

but I get stuck in a loop when somebody is updating a record and not releasing the lock. How can I code around this problem so that after n seconds I can send a message to the user that there's a lock.

2)would it be better to substitute the code with execute immediate?

Thanks a million Marco
Re: advice on lock [message #38138 is a reply to message #38124] Mon, 25 March 2002 00:33 Go to previous message
Epe
Messages: 99
Registered: March 2002
Member
Yow Marco,

can't you lock it yourself by using "...for update of..." at the end of the select statement of your cursor ? Then your lock will be released after commiting, wich will happen at the end of your procedure (hopefully)...

Good luck,

Epe
Previous Topic: Executing SQL Statement on ASP
Next Topic: reading unix files using PL/SQL
Goto Forum:
  


Current Time: Thu Apr 18 12:43:51 CDT 2024