Use variables in several different places in a big SELECT query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Roobmeister
    New Member
    • Aug 2007
    • 16

    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
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    you can use TOAD or PLSQL DEVELOPER for the purpose.

    Comment

    • Saii
      Recognized Expert New Member
      • Apr 2007
      • 145

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

      Comment

      Working...