//Iki Fungsi Gawe Ngitung jumlah No Kamar seng digoleki
CREATE OR REPLACE FUNCTION Cek_Kamar (No_Kamar IN varchar2)
RETURN NUMBER AS
hasil NUMBER(10);
BEGIN
SELECT COUNT(*) INTO hasil FROM transaksi WHERE NO_KAMAR='No_Kamar';
dbms_output.put_line(hasil);
return hasil;
END;
//iki ngeksekusi fungsi
declare
a Number(8);
BEGIN
a:=Cek_Kamar('KM02');
dbms_output.put_line(a);
END;
//Pertanyaan : Lapo return valuene mesti 0 padahal 'KM02' iku datane onok nak database, query ne yo wes tak cobak iso nampilno mek nak fungsine thok return ne mesti 0
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.