|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
PL/SQL: Quick question on 'Table of records'
Hi,
is there any way to sort a PL/SQL table of records by a specific record field?? Many thanks |
|
#2
|
|||
|
|||
|
The only way for sorting is using order by clause, you can use it while retrieving or inserting records.
If there is some other scenario then please write briefly. Regards Ankur |
|
#3
|
|||
|
|||
|
ORDER BY clause only available for this purpose, you can use it in both SQL and PL/SQL. could you please explain your question little bit more???
|
|
#4
|
|||
|
|||
|
I guess you are talking about the PL/SQL table created inside the code ( within packages / Proedures )
Then there is no way to sort the PL/SQL table . Think of PL/SQL table as a array storing the data.. If you want to sort out the data from this you would have to write your own sorting algo Cheers Santosh |
|
#5
|
|||
|
|||
|
Quote:
Yes, that's what I was talking about- not a database table that can be sorted with ORDER BY, but a table created like this: Code:
TYPE t_nom_rec IS RECORD (obj_id t_nom.obj_id%TYPE,
telex_id t_nom.telex_id%TYPE,
facility_desc t_facility.facility_desc%TYPE,
shipper_desc t_shipper.shipper_desc%TYPE,
nomination_type t_lookup.lk_desc%TYPE,
effective_hour t_nom.effective_hour%TYPE,
quantity t_nom.quantity%TYPE,
approved_ind t_nom.approved_ind%TYPE,
verified_ind t_nom.verified_ind%TYPE,
superseded_ind t_nom.superseded_ind%TYPE,
agg_ind t_nom.agg_ind%TYPE,
rejected_ind t_nom.rejected_ind%TYPE);
TYPE t_nom_tab IS TABLE OF t_nom_rec INDEX BY BINARY_INTEGER;
v_nom_tab t_nom_tab;
So there's no way of ordering by field without using your own algorithm? That's bad news |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > PL/SQL: Quick question on 'Table of records' |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|