1. The simple example
-- this will make sure the result output to the Script Output(or the console)
SET SERVEROUTPUT ON
-- below command will clear the screen before you output new content
clear screen
Declare
newid varchar2(100);
begin
select 123 into newid from dual;
dbms_output.put_line('new id is:' || newid);
end;
/
2. get result after insertion
INSERT INTO mytable (NAME) VALUES(1,'xx','data')
return id into newid; -- id is one of the mytable's column
Comments
Post a Comment