With this,
set serveroutput on size 900000;
DECLARE
test VARCHAR(255):=0;
BEGIN
SELECT id INTO test FROM sku WHERE id = 1515;
dbms_output.put_line('Result:' || test);
END;
I'm having the error
"no data found"
When ID doesn't exist in database.
How can I use something like nvl()
here, so I can get a default value instead of get an error?