Created
April 5, 2013 11:52
-
-
Save eftakhairul/5318723 to your computer and use it in GitHub Desktop.
it's a Oracle Stored Procedure which actually select multiple rows and inserts those with some new parameters...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SAVEPOINT INSERT_DOCUMENT_DATE; | |
BEGIN | |
FOR i in (SELECT document_id | |
FROM document_date | |
WHERE type_id = 5 AND document_id not in (SELECT document_id FROM document_date where type_id = 6) AND day < TO_DATE(CURRENT_DATE, 'DD-MON-RR')) LOOP | |
INSERT INTO document_date(ID,DOCUMENT_ID,type_id,day) VALUES(DOCUMENT_DATE_ID_SEQ.nextval, i.document_id, 6, TO_DATE(CURRENT_DATE, 'DD-MON-RR')); | |
END LOOP; | |
END; | |
/ | |
ROLLBACK TO INSERT_DOCUMENT_DATE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment