Home » SQL & PL/SQL » SQL & PL/SQL » prob in selecting from type(collection)
prob in selecting from type(collection) [message #215818] Wed, 24 January 2007 00:29 Go to next message
sanammg
Messages: 31
Registered: June 2005
Member
i created the type like below.
i want to find out the max val of two columns like...


TYPE GCR_OUT IS RECORD (GCR_Q NUMBER, QC_M VARCHAR2(10),NO_OF_MOVE NUMBER);

TYPE TYP_GCR_OUT IS TABLE OF GCR_OUT
INDEX BY BINARY_INTEGER;

type is like
GCR_Q QC_M NO_OF_MOVE
3 ab 23
6 mn 35
4 sq 46
2 mo 31

i want to get 6 from GCR_Q column and 46 from NO_OF_MOVE column
how?
Re: prob in selecting from type(collection) [message #215824 is a reply to message #215818] Wed, 24 January 2007 00:46 Go to previous message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
For PL/SQL types, you will have to loop through the collection with - say - a FOR loop. It it was a NESTED TABLE, (created on the Database) you would be able to use SQL on it with a TABLE() function. This is covered in the SQL Reference Manual.

Ross Leishman
Previous Topic: pl/sql help
Next Topic: min marks from subjects
Goto Forum:
  


Current Time: Thu Dec 08 04:04:47 CST 2016

Total time taken to generate the page: 0.07163 seconds