Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 13th, 2008, 02:37 PM
Newbie
 
Join Date: Aug 2007
Posts: 9
Default Use variables in several different places in a big SELECT query

Hi, I am new to Oracle, and can't find the answer for this anywhere.

I have a giant SELECT query for a data extract that includes many subqueries.

I would like to limit the data being queried to a particular date range, and I need to do this in at least 30 different date ranges in my select query (to improve processing time) - so basically my query would call the two variables in 30 different places.

In SQL Server, I would've just created a stored procedure with the two variables, and executed it, putting the variable values in my EXEC statement.

I just need to be able to output the data to a spreadsheet or text file, and I'm looking for the easiest way to do this.

What tools does Oracle have that I can use for this, and what specific syntax would I need to use?

Thanks
Reply
  #2  
Old August 13th, 2008, 03:26 PM
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 6,867
Default

you can use TOAD or PLSQL DEVELOPER for the purpose.
Reply
  #3  
Old August 13th, 2008, 05:11 PM
Saii's Avatar
Expert
 
Join Date: Apr 2007
Posts: 130
Default

encapsulate your code into a oracle procedure and pass the date parameters. You can also write the output from this query to a flat file using UTL_FILE.
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles