Advertisement
xlrnxnlx

4

Jun 4th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.48 KB | None | 0 0
  1. DECLARE
  2.   v_nome cliente.nome%TYPE;
  3.   v_uf saques.cod_uf%TYPE;
  4.   v_total saques.qtd_total_saque%TYPE;
  5.  
  6. BEGIN
  7.   SELECT c.nome, s.cod_uf INTO v_nome, v_uf
  8.   FROM cliente c, cidade_agencias ag, saques s
  9.   WHERE c.idade > 50
  10.   AND c.codcid_ag = ag.codigo
  11.   AND ag.uf = s.uf;
  12.  
  13.   UPDATE saques
  14.   SET qtd_total_saque = qtd_total_saque + 1000
  15.   WHERE cod_uf = v_uf
  16.   RETURN qtd_total_saque INTO v_total;
  17.  
  18.   DBMS_OUTPUT.PUT_LINE('c/ acrescimo: '|| v_total|| ' cliente: '||v_nome);
  19. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement