Advertisement
Guest User

Untitled

a guest
May 21st, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.56 KB | None | 0 0
  1.  
  2. SET SERVEROUTPUT ON;
  3. DECLARE
  4. v_titlu carti.titlu%TYPE;
  5. v_exemplare carti.titlu%TYPE;
  6. BEGIN
  7. SELECT titlu, nr_exemplare INTO v_titlu ,v_exemplare FROM carti WHERE id_carte = 888;
  8. DBMS_OUTPUT.PUT_LINE('Titlu carte: ' || v_titlu);
  9. DBMS_OUTPUT.PUT_LINE('Numarul initial de exemplare: ' || v_exemplare);
  10. IF v_exemplare < 100 THEN v_exemplare :=v_exemplare * 1.5;
  11. ELSIF v_exemplare BETWEEN 100 AND 150 THEN v_exemplare := v_exemplare *1.3;
  12. ELSE v_exemplare := v_exemplare *1.2;
  13. END IF;
  14. DBMS_OUTPUT.PUT_LINE('Numarul final de exemplare: ' || v_exemplare);
  15. END;
  16. /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement