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

Thread: Dd link parameter

  1. #1
    Join Date
    Nov 2000
    Location
    Birmingham, UK
    Posts
    360

    Dd link parameter

    I'm trying to pass in the first part of a db link with a parameter in a procedure but cant seem to get the syntax right - can anyone please help?

    Code:
    PROCEDURE INVALID_OBJECTS1  (p_dbsid varchar)
       IS
    cursor c_total_inv_obj is
          select owner,object_name, object_type 
          from dba_objects@p_dbsid||'.world'
          where  status = 'INVALID'
          and    object_type in ('PACKAGE BODY','PACKAGE','FUNCTION',
                                 'PROCEDURE','TRIGGER','VIEW','QUEUE');

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    you can't do it throught straight pl/sql like that. You have to use dynamic sql.
    Jeff Hunter

  3. #3
    Join Date
    Aug 2001
    Posts
    267
    As Jeff mentioned use execute immediate

    v_sql = 'select .... oracle' + '.world'

    execute immediate(v_sql)
    Raghu

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    You should take a look at ref cursors.

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