0

I'm in the situation to create the procedure with 2 temporary tables. Example : ActionCode 1. If values are other than ADD/CHG/DEL, reject the record LastModifiedDate "1. Mandatory field checking: if Null, reject the record 2. Format validation: If other than yyyy-mm-dd hh:mm:ss format, reject the record 3. If date greater than current date, reject the record"

First temporay table will contain the records which satisfy first condidtion. 2nd temporary table will contain the records which satisfy 2nd condition from the first temporary table record. Like that i have short down the records. Example out of 20 records 10 records satisfy the first condition , 1st temporary table will hold that. Then Out of that 10 records only 5 records satisfy 2nd condition, 2nd temporary table will hold that. Like that i have 20 condition to narrow down the records. PLease help me how i can achieve this. Thank you!

user3607647
  • 51
  • 2
  • 14
  • Trying something would be helpful – Mihai Oct 12 '15 at 07:27
  • 1
    Create global temporary tables http://stackoverflow.com/questions/20706724/how-to-use-oracle-global-temporary-table Now insert into first table based on your condition. Then Insert into second table seleclting from first table based on condition. Try this and if you face any error or something, ask a new question telling what you want/ what did you try and what is the error you are getting. – Utsav Oct 12 '15 at 08:00
  • 1
    Why do you need temporary tables to achieve this? Do you really mean global temporary tables, or PL/SQL collections? Where are the original 20 records coming from (a query?), where are the five valid ones going (inserting into another table)? What, if anything, should happen to the rejected records? – Alex Poole Oct 12 '15 at 10:06
  • 20 records coming from Source and I'm storing it in a table. Rejected records has to be pushed into a seperate table called rejected table. I tried to do it using temporary tables only. Is it a correct way to do it. – user3607647 Oct 12 '15 at 12:04

0 Answers0