Home » SQL & PL/SQL » SQL & PL/SQL » Record type
Record type [message #389465] Mon, 02 March 2009 03:36 Go to next message
sivakumar.rj
Messages: 17
Registered: November 2008
Location: Chennai
Junior Member
Hi all,

pls tell me how to write the code for the below scenario.

I am having two tables A and B. For a particular id in A table, there exists more than the number of records in B table. For eg., in A table for a value of 90877678, there will be 89,78,67,45 number of rows will be existed. Now what I have to do is for a particular value for A, I need to fetch all the value for B and store it in a array.

i.e 98034 XXX 21
98034 XXX 27
98034 XXX 29
98034 XXX 20

like this I have to store. Then whenever I am inserting the value I need to compare all the value which is already in an array. i.e suppose the index starts at 10,
10 - 98034 XXX 21
20 - 98034 XXX 27
30 - 98034 XXX 29
40 - 98034 XXX 20
50 - 98787 YYY 27

For the index value 50 I need to represent it by the index value of 20.

Help on this.....




Re: Record type [message #389467 is a reply to message #389465] Mon, 02 March 2009 03:44 Go to previous message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your first topic:
Michel Cadot wrote on Mon, 24 November 2008 08:59
...
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and use code tags.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel


Post a Test case: create table and insert statements along with the result you want with these data.
Previous Topic: reuse a computed value for each row in SQL
Next Topic: cursors in trigger
Goto Forum:
  


Current Time: Fri Dec 09 21:36:17 CST 2016

Total time taken to generate the page: 0.13401 seconds