I want to run a procedure to force a row lock on a row, but I don’t want to return a result set to the client, nor do I actually want to update anything. Below is the proc:
CREATE OR REPLACE PROCEDURE SP_LOCK_Row
(IDRow IN INTEGER)
IS
BEGIN
SELECT *
FROM TBLTable
WHERE IDRow = IDRow
FOR UPDATE;
END;
The problem is that I keep getting the error: PLS-00428: an INTO clause is expected in this SELECT statement. Is there a way for me to lock the row without actually having to return a result set back to the client? The SQL Server equivalent is:
CREATE PROCEDURE dbo.SP_LOCK_Row(
@IDRow INT)
AS
SELECT *
FROM dbo.TBLTable WITH (UPDLOCK, ROWLOCK)
WHERE IDRow = @IDRow
Tks
I don’t know how smart it is to code this way but this:
should do the trick.
Ronald – http://ronr.blogspot.com