plsql
Posted April 15th, 2010 by admin
First PLSQL procedure
Connect to sqlplus
insert this code to sql shell:
CREATE OR REPLACE procedure giorgio(var in varchar2) is
contenent number(20);
BEGIN
select test_id into contenent from test where test_id= var;
dbms_output.put_line(contenent);
END;
/
now try to execute the your first procedure:
sql>set serveroutput
sql>exec giorgio()
Posted April 15th, 2010 by admin
Loop in PLSQL
A easy example to implement a loop into plsql procedure
declare
pippo number(38);
begin
pippo:=0;
loop
insert into test32 values (pippo);
pippo:=pippo+1;
if pippo=4 then
exit;
end if;
end loop;
end;
/
