DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Variable in a query

  1. #1
    Join Date
    Feb 2000
    Location
    phoenix, AZ,USA
    Posts
    20

    Angry

    Can I use a variable name in a select statement inside a PL/SQL block. I was wondering if I could pass a variable name for the tablename in a select query.


    Thanks in advance for any help.

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Sure you can. You will have to use a feature called Native Dynamic SQL. See ( [url]http://www.oracle.com/oramag/oracle/00-nov/o60sql.html[/url] )
    Jeff Hunter

  3. #3
    Join Date
    Feb 2000
    Location
    phoenix, AZ,USA
    Posts
    20

    Question

    Thank you.

    That was an interesting URL that you had pointed to. That could have satisfied my requirements, had we been using ORacle8i. Is it available on 8.0? It doesn't seem to recognize the 'EXECUTE IMMEDIATE' command. Or is there something that I am missing. Or is there specific setup needed to use this feature?







  4. #4
    Join Date
    Aug 2000
    Posts
    194
    see whether your version has DBMS_SQL package, which supports dynamic sql including DDLs.

  5. #5
    Join Date
    Feb 2000
    Location
    phoenix, AZ,USA
    Posts
    20

    Wink

    Thank You. It worked.

Posting Permissions

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


Click Here to Expand Forum to Full Width