Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL help needed to loop through tables (Oracle)
PL/SQL help needed to loop through tables [message #328065] Wed, 18 June 2008 14:45 Go to next message
MK7077
Messages: 1
Registered: June 2008
Location: india
Junior Member
I have to write a procedure which does the following

1)it should select the rows from the temp table and match with the table1 rows
note : there is second table, table 2
table 1 and table 2 have m to m relation
ex: 4rows in table1 will have 4 rows in table2.
the uniqueness of the rows is based on 3 columns in both the tables
2)i should write a procedure which will compare these 4 rows in table 1 with the 4 rows in table 2.it should compare column by column of all the 3 main columns .
if all the 3 column values of the 2 tables match for those 4 records then it should perform some updates on table1 and table3(this is another table again).if they doesnt match those records i should write to another temp table.

how can i perform the second step. Please throw some light.
please let me know if you have any questions.

Thanks
Asha
Re: PL/SQL help needed to loop through tables [message #328066 is a reply to message #328065] Wed, 18 June 2008 14:50 Go to previous messageGo to next message
BlackSwan
Messages: 25037
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & follow posting guidelines as stated in URL above
Re: PL/SQL help needed to loop through tables [message #328067 is a reply to message #328065] Wed, 18 June 2008 14:58 Go to previous message
Michel Cadot
Messages: 64109
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
First you have to ask you: can you do it in pure SQL and avoid all these temp table and code.
Oracle is not SQL Server, it almost never needs temp table.

Regards
Michel
Previous Topic: Capture encrypted email from POP3/IMAP server
Next Topic: Duplicate Rows
Goto Forum:
  


Current Time: Mon Dec 05 07:02:01 CST 2016

Total time taken to generate the page: 0.10468 seconds