Declaration of package
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Declaration of package

  1. #1
    Join Date
    May 2006
    Posts
    51

    Declaration of package

    Below declare of package is correct or wrong

    ACT1 IN OUT GLOBALPKG.ACT1

    Thanks for your assistance

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    What??????
    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
    May 2006
    Posts
    51
    is in out in the syntax is right or wrong

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,997
    Quote Originally Posted by vision
    is in out in the syntax is right or wrong
    Look at this from http:/tahiti.oracle.com

    And if you are passing large objects you might consider adding the nocopy directive, which is the same as pass by reference.
    this space intentionally left blank

  5. #5
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Depends on what that line of code actualy reepresents. If it is a declaration of a procedure/function parameter and if the "GLOBALPKG.ACT1" represents a user-defined datatype, then yes, it could be a valid line of PL/SQL code. What actually bothers you regarding "in out"? Any function/procedure parameter can be of type "IN", "OUT" or "IN OUT".
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  6. #6
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,997
    Quote Originally Posted by jmodic
    Depends on what that line of code actualy reepresents. If it is a declaration of a procedure/function parameter and if the "GLOBALPKG.ACT1" represents a user-defined datatype, then yes, it could be a valid line of PL/SQL code. What actually bothers you regarding "in out"? Any function/procedure parameter can be of type "IN", "OUT" or "IN OUT".
    IN OUT is fine, but if you pass by value Oracle will create a new version of the variable and populate it. Which for a Varchar2 or a Number is fine, but if the parameter is large, and if you are going to return an updated value anyway you might as well pass by reference.
    this space intentionally left blank

  7. #7
    Join Date
    May 2006
    Posts
    51
    But I'm this erorr where do I need to declare the package
    38 PLS-00201: identifier GLOBALPKG.ACT1 must be declared

  8. #8
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,997
    Quote Originally Posted by vision
    But I'm this erorr where do I need to declare the package
    38 PLS-00201: identifier GLOBALPKG.ACT1 must be declared
    It would help to see the context for this code as well as the entire error message.
    this space intentionally left blank

  9. #9
    Join Date
    May 2006
    Posts
    51
    this is entire code
    CREATE OR REPLACE PROCEDURE Audit.STD_Sheet_GETVITALS
    (
    case_id IN INT DEFAULT NULL,
    cetype IN VARCHAR2 DEFAULT null,
    ACT1 IN OUT GLOBALPKG.ACT1
    )

    AS
    lookup_type VARCHAR2(10);
    BEGIN
    lookup_type := '100001';
    /* This is the lookup value for the vitals stored in the gen_node tables*/
    /* Get the non vital data*/

    OPEN ACT1 FOR
    SELECT
    'Variable Prompt' as prompt_label,
    node_descrp as prompt,
    'Variable Value' as flow_value_label,
    flow_value,
    'Date Time' as flow_datetime_label,
    flow_datetime,
    'Comments' as flow_comment_label,
    flow_comment
    FROM doc_flowsheet,
    sys_tree,
    sys_node
    WHERE tree_id = flow_treeid
    AND (tree_nodeid = node_id)
    AND (flow_handle = case_id
    AND flow_cetype != lookup_type)
    UNION
    SELECT/* Get the vital data. We get the description */
    'Variable Prompt' as prompt_label,
    gnode_descrp as prompt,
    'Variable Value' as flow_value_label,
    flow_value,
    'Date Time' as flow_datetime_label,
    flow_datetime,
    'Comments' as flow_comment_label,
    flow_comment
    FROM doc_flowsheet,
    gen_node
    WHERE gnode_id = flow_treeid
    AND (flow_handle = case_id
    AND flow_cetype = lookup_type)

    ORDER BY prompt,
    flow_value,
    flow_datetime;
    END;
    /
    I'm getting this error

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    0/0 PL/SQL: Compilation unit analysis terminated
    5/38 PLS-00201: identifier 'GLOBALPKG.ACT1' must be declared

  10. #10
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,997
    Who owns GLOBALPKG? Make sure you have the right direct grants.

    Code:
    SELECT * 
      FROM dba_dependencies 
     WHERE NAME = 'GLOBALPKG';
    
    SELECT * 
      FROM DBA_TAB_PRIVS 
     WHERE grantee = 'AUDIT';
    this space intentionally left blank

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