It is required to add the SELECT value to the variable:
(SELECT * FROM ( SELECT PERSON_EMAIL FROM PERSONS WHERE rownum BETWEEN 1 AND ID ORDER BY rownum DESC) WHERE rownum=1);
I try to do this:
EMAIL := (SELECT * FROM ( SELECT PERSON_EMAIL FROM PERSONS WHERE rownum BETWEEN 1 AND ID ORDER BY rownum DESC) WHERE rownum=1);
or so:
SET EMAIL = SELECT * FROM ( SELECT PERSON_EMAIL FROM PERSONS WHERE rownum BETWEEN 1 AND ID ORDER BY rownum DESC) WHERE rownum=1;
In this case, pre-announcing the email in DECLARE this way:
email varchar2(4000);
But in any case, does not allow to execute the command. How correctly to bring in a variable?