dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

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 ...


Home > Database Forum > Oracle Database > Oracle Tools > help with writing a complex SQL statement

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 11-17-2005, 05:37 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default help with writing a complex SQL statement

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

Reply With Quote
  #2  
Old 11-17-2005, 06:49 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: help with writing a complex SQL statement

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)
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 12:20 PM.