SHARE
TWEET

Untitled

a guest Apr 18th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. alter user maluricag_44 identified by stud;
  2.  
  3. --pachete--
  4. --au 2 comp principale: 1.specificatii:parte publica, contine antetul functiilor si procedurilor, este obligatorie
  5. --                      2. corpul:implementarea functiilor si procedurilor anuntate in specificatii+functii si proceduri private, este optionala
  6.  
  7.  
  8. create or replace package grupa_1044 is
  9.  cota_tva constant number :=19;
  10.  function get_val_cu_tva(p_val number) return number;
  11.  
  12.  end;
  13.  /
  14.  
  15.  create  or replace package body grupa_1044 is
  16.  function get_val_cu_tva(p_val number) return number
  17.  is
  18.  begin
  19.  return p_val + (1+cota_tva/100);
  20.  end get_val_cu_tva;
  21.  
  22.  function get_val_cu_tva(p_val number, p_cota number) return number
  23.  
  24.  
  25.  end grupa_1044;
  26.  /
  27.  
  28.  set serveroutput on
  29.  begin
  30.  dbms_output.put_line('cota standard TVA: ' || grupa_1044.cota_tva);
  31.  dbms_output.put_line('Valoare cu standard TVA: ' || grupa_1044.get_val_cu_tva(200));
  32.  end;
  33.  /
  34.  
  35.  select * from user_source where name='GRUPA_1044';
  36.  
  37.  select id_client, nume_client, grupa_1044.get_val_com(id_client);
  38.  from clienti;
  39.  
  40.  --sa se construiasca un pachet ce contine o functie si o procedura si sa se apeleze functia si procedura--
  41.  
  42.  create or replace package malurica_1044 is
  43.  curs_euro constant number :=4.63;
  44.  function get_curs_euro(p_curs_euro number) return number;
  45.  end;
  46.  /
  47.  create  or replace package body malurica_1044 is
  48.  function get_curs_euro(p_curs_euro number) return number
  49.  is
  50.  begin
  51.  return p_curs_euro
  52.  end get_curs_euro;
  53.  
  54.   function get_curs_euro(p_curs_euro, number, p_curs_euro number) return number
  55. end malurica_1044;
  56.  
  57. set serveroutput on
  58.  begin
  59.  dbms_output.put_line('curs schimb euro: ' || malurica_1044.curs_euro);
  60.  end;
  61.  /
  62.  
  63.  
  64.  create or replace package diaconita is function suma(n1 number, n2 number) return number;
  65.  procedure Paste_Fericit(p_nume varchar2, p_urare OUT varchar2);
  66.  end;
  67.  
  68.  create or replace package body diaconita is function suma(n1 number, n2 number) return number
  69.  is
  70.  begin
  71.  return n1+n2;
  72.  end suma;
  73.  procedure Paste_Fericit(p_nume varchar2, p_urare OUT varchar2);
  74.  end;
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