In the following example,
variable recordId number;
BEGIN
SELECT MAX(recordvalue)
INTO recordId
FROM sometable;
END;
PRINT recordid;
SELECT *
FROM someothertable
WHERE recordkey = &recordId;
The select statement on the last line cannot access the value of recordId.
I know i can access recordId
inside the pl/sql block using :recordId but is there a way to access recordId
in a sql statement that is not in a pl/sql block? (like in the last line).