help with writing a complex SQL statement - Oracle Tools
This is a discussion on help with writing a complex SQL statement - Oracle Tools ; I need to write a single query and need help with this. I have a PL/SQL function that accepts an array called metadataarray as an in parameter and returns the latest seq number. This array is of record type metadatatype ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| I have a PL/SQL function that accepts an array called metadataarray as an in parameter and returns the latest seq number. This array is of record type metadatatype with 3 elments source_code, source_date, seq I have a priority_table that determines which source_code has higher priority. Examples of records in this table are: Telcom 1 Reuters 2 YellowPages 3 etc. The logic is as follows: Match the input parameter with the priority_table on source_code and sort the results by source_date, priority. Return the seq associated to the first record. Can I do this in a simgle SQL statement? Thanks |
|
#2
| |||
| |||
| shanthi.viswanathan@gmail.com wrote: > I need to write a single query and need help with this. > > I have a PL/SQL function that accepts an array called metadataarray as > an in parameter and returns the latest seq number. This array is of > record type metadatatype with 3 elments source_code, source_date, seq > > I have a priority_table that determines which source_code has higher > priority. Examples of records in this table are: > Telcom 1 > Reuters 2 > YellowPages 3 etc. > > The logic is as follows: > Match the input parameter with the priority_table on source_code and > sort the results by source_date, priority. Return the seq associated to > the first record. > > Can I do this in a simgle SQL statement? > > > Thanks No. You will need PL/SQL. -- Daniel A. Morgan http://www.psoug.org damorgan@x.washington.edu (replace x with u to respond) |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 12:20 PM.




Linear Mode