daily pastebin goal
7%
SHARE
TWEET

sample oracle stored procedure

falconaut Aug 2nd, 2012 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE OR REPLACE PACKAGE kapel_info AS
  2.         PROCEDURE kapel_bertuah_or_malang(p_id IN VARCHAR2, p_keputusannya OUT VARCHAR2);
  3. END kapel_info;
  4.  
  5. CREATE OR REPLACE PACKAGE BODY kapel_info AS
  6.         PROCEDURE kapel_bertuah_or_malang(p_id IN VARCHAR2, p_keputusannya OUT VARCHAR2) IS
  7.                 v_malang_tak VARCHAR2;
  8.                 CURSOR curkapel
  9.                 IS
  10.                 SELECT nama_laki, nama_bini, bini_lawa, bini_kaya, bini_beriman, bini_pisau_cukur
  11.                 FROM   info_pasangan
  12.                 WHERE  id_laki = p_id;
  13.                 reckapel curkapel%ROWTYPE;
  14.         BEGIN
  15.                 FOR reckapel IN curkapel
  16.                 LOOP
  17.                         SELECT DECODE(reckapel.bini_lawa||reckapel.bini_kaya||reckapel.bini_beriman||reckapel.bini_pisau_cukur,
  18.                                 'YYYY',' adalah seorang laki yang amat BERTUAH',
  19.                                 'TTTT',' adalah laki yang paling MALANG di dunia',
  20.                                 ' adalah laki separuh MALANG - :)')
  21.                         INTO v_malang_tak
  22.                         FROM sys.dual;
  23.                         p_keputusannya := reckapel.nama_laki||v_malang_tak;
  24.                         DBMS_OUTPUT.putline(p_keputusannya);
  25.                 END LOOP;
  26.         END kapel_bertuah_or_malang;
  27. END kapel_info;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top