Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Location
    New York
    Posts
    45

    Unanswered: create a variable for report

    Hello

    I have a report that runs a sql and spool output to a test file. I have two variables in there. &start_date and &end_date...

    I have to insert these variables everytime I run this scrip.

    Is there a way to declare these variables in the begining so the sql (query) can take it and run it without me entering it all the time.

    set linesize 200
    set pagesize 200
    clear screen
    spool \d:\text.txt
    prompt
    my slq
    prompt
    spool off

    Thank you

    Al

  2. #2
    Join Date
    Apr 2004
    Posts
    246
    use && instead of &, and you will only be prompted once
    Give a man a fish, you feed him for a day. Club him over the head with a fish, he'll leave you alone.

  3. #3
    Join Date
    Feb 2004
    Location
    New York
    Posts
    45
    I do not want to insert it with prompt , just would like to have it in my script so by the declaring it in a scrip and than in the sql it will be grab it and posted to sql itself /

    Thank you

  4. #4
    Join Date
    Apr 2004
    Posts
    246
    then define it

    def var = 'some value'

    select '&var' ....
    Give a man a fish, you feed him for a day. Club him over the head with a fish, he'll leave you alone.

  5. #5
    Join Date
    Jan 2004
    Location
    Scottsdale, AZ
    Posts
    106

    Post

    Quote Originally Posted by alexis200487
    I do not want to insert it with prompt , just would like to have it in my script so by the declaring it in a scrip and than in the sql it will be grab it and posted to sql itself /

    Thank you
    http://download-west.oracle.com/docs...h3.htm#1002085
    "Take Control!
    Make The Choice!
    Accept The Consequences!
    Deal With The Results! "

  6. #6
    Join Date
    Feb 2004
    Location
    New York
    Posts
    45
    it worked, thank you so much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •