Run Oracle Procedure just to lock row, without returning a resultset
- by Pascal
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