I am writing a SQL procedure to perform following task.
- Read data from a table A. Which have columns are Col1, Col2, Col3, Col4, Col5, Col6.
- I have to search primary key (number) in table B and filed Col1,Col2,Col3.
- Insert the primary key,COL4,COL5,COL6 in table 6.
Table A can contain any number of combination of COL1, COL2 and COL3.
Here I am reading all data from table A but I don’t want to fire a search query on table B every time to find out the key in table B. But I like to store/fetch data of table B in somewhere (map etc) and then want to search there and insert in the table C. Is it possible in PL/SQL?
In short, I want to cache table B data and perform the search and get there data.
insert ... select
in one simple step? – Alex Poole