ora-02014

ORA-02014- How do I update a randomly selected row from a table?

I'm trying to randomly select a card from a table of cards with columns c_value and c_suit using a procedure. After selecting it, the procedure should update that entry's taken field to be 'Y'. create or replace procedure j_prc_sel_card(p_value OUT number, p_suit OUT number) AS CURSOR CUR_...

How can I use "FOR UPDATE" with a JOIN on Oracle?

The answer to another SO question was to use this SQL query: SELECT o.Id, o.attrib1, o.attrib2 FROM table1 o JOIN (SELECT DISTINCT Id FROM table1, table2, table3 WHERE ...) T1 ON o.id = T1.Id Now I wonder how I can use this statement together with the keyword FOR UPDATE. If I simply append it to the query, Or...

How to work around ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.

I want to lock one record in a table. The record is specified as "the next that has ID greater than..." CREATE TABLE test (id number); SELECT id FROM (SELECT id FROM test WHERE id > 10 ORDER BY id) WHERE ROWNUM = 1 FOR UPDATE; This seems intuitive and easy. But it is not. Any ideas? P.S. I do need the existing qu...