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

Thread: using cursor parameter in the from clause...

Hybrid View

  1. #1
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809

    Question using cursor parameter in the from clause...

    Has someone ever tried to give the schema used in a cursor's query as a parameter to this cursor ?

    Something like :

    [...]
    cursor my_cursor (my_schema varchar2)
    is
    select whatever from my_schema.table;
    [...]

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Object identifiers (schema name, table name, ....) can't be substituted with bind variables. Annd parameters in this case are just that - bind variables.

    So no, it can't be done directly. You could use dynamic sql, though. But of course again, you will not be able to use binding method - you will have to use concatenation to construct your cursor and then execute it.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809
    Thx for your fast and efficient answer Juri

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