locking rows with DBMS_SQL
From: Javier Rojas <jrv_at_quisar.com>
Date: Thu, 02 Jul 1998 14:00:52 +0200
Message-ID: <359B7674.4736663_at_quisar.com>
[Quoted] I want to lock rows using the function above but it doesn't lock the row selected (no errors) WHY ???.
Is there another way to do dynamic row locking ???
END; TIA Javier Rojas. Received on Thu Jul 02 1998 - 14:00:52 CEST
Date: Thu, 02 Jul 1998 14:00:52 +0200
Message-ID: <359B7674.4736663_at_quisar.com>
[Quoted] I want to lock rows using the function above but it doesn't lock the row selected (no errors) WHY ???.
Is there another way to do dynamic row locking ???
if sql_lock('SELECT pk_id FROM table WHERE pk_id = 12345 FOR UPDATE')
then
row lock SUCCESS...
else
row lock NOT SUCCESS....
end if;
[Quoted] FUNCTION sql_lock(sql_text IN VARCHAR2) RETURN BOOLEAN IS
cur_id NUMBER;
status NUMBER;
BEGIN
cur_id := dbms_sql.open_cursor;
dbms_sql.parse(cur_id, sql_text, DBMS_SQL.NATIVE);
status := dbms_sql.execute(cur_id); status := dbms_sql.fetch_rows(cur_id); dbms_sql.close_cursor(cur_id);
if status > 0 then
RETURN TRUE;
else
RETURN FALSE;
end if;
EXCEPTION
when OTHERS then
if dbms_sql.is_open(cur_id) then dbms_sql.close_cursor(cur_id); end if; RETURN FALSE;
END; TIA Javier Rojas. Received on Thu Jul 02 1998 - 14:00:52 CEST