Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Declare
- Cursor budget_cursor is (select * from budget where NOM_OPERATION='Courses') ;
- ligne budget_cursor % Rowtype;
- Begin
- open budget_cursor;
- loop
- Fetch budget_cursor into ligne;
- exit when budget_cursor%NotFound ;
- INSERT INTO Courses VALUES (ligne.num_operation,ligne.nom_operation,ligne.categorie,ligne.date_operation,ligne.montant) ;
- end loop;
- close budget_cursor;
- END;
- /
- -----------------------------------------
- DECLARE
- max_operation integer;
- new_solde integer;
- Begin
- select max(num_operation)+1 into max_operation from budget;
- select solde-500 into new_solde from budget where num_operation=(select max(num_operation)
- from budget);
- INSERT INTO BUDGET VALUES(max_operation,'Courses','Ddebit','14/01/2002',500,new_solde);
- End;
- /
- ---------------------------------------------
- truncate table BUDGET_EURO;
- Declare
- Cursor budget_ecursor is (select * from budget where DATE_OPERATION >'01/01/2002') ;
- ligne budget_ecursor % Rowtype;
- Begin
- open budget_ecursor;
- loop
- Fetch budget_ecursor into ligne;
- exit when budget_ecursor%NotFound ;
- INSERT INTO BUDGET_EURO VALUES (ligne.num_operation,ligne.nom_operation,ligne.categorie,ligne.date_operation,ligne.montant/11) ;
- end loop;
- close budget_ecursor;
- END;
- /
- ---------------------------------------------
- truncate table budget_seuil;
- Accept x number Prompt " Entrez le seuil : "
- Declare
- Cursor budget_eSeuil(s number) is (select Num_operation,Date_operation,montant from budget where montant > s) ;
- ligne budget_eSeuil % Rowtype;
- seuil number;
- Begin
- seuil:=&x;
- open budget_eSeuil(seuil);
- loop
- Fetch budget_eSeuil into ligne;
- exit when budget_eSeuil%NotFound ;
- INSERT INTO BUDGET_SEUIL VALUES (ligne.num_operation,ligne.date_operation,ligne.montant) ;
- end loop;
- close budget_eSeuil;
- END;
- /
- ------------------------------------------
- truncate table budget_seuil;
- Accept x number Prompt " Entrez le seuil : "
- Declare
- Begin
- for ligne in (select Num_operation,Date_operation,montant from budget where montant > &x)
- loop
- INSERT INTO BUDGET_SEUIL VALUES (ligne.num_operation,ligne.date_operation,ligne.montant) ;
- end loop;
- END;
- /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement