Apa Stored Procedure?
•Procedure atau Function di dalam database.
•Stored procedure à SQL + Bahasa Prosedural
•Banyak disupport oleh
RDBMS (ORA, SQL Server, MySQL versi 5 ke atas)
Contoh
Program untuk mengisi sebuah field dengan deret 2, 4, 6 sd 100
create or replace procedure isi_deret
as
counter INTEGER;
begin
counter := 0;
loop
insert into DERET(NILAI) values (counter);
counter
:= counter + 2;
exit
when counter > 100;
end
loop;
end;
Tidak ada komentar:
Posting Komentar