Newbie Region SQL calling a package Procedure

I have a region on a page with PL/SQL selected.
Below is the code I have for "REGION SOURCE"
begin
htp.p('Help me');
WILD4BLIFE.TESTA();
end;
==============
I have a Package WILD4BLIFE with a procedure TESTA.
I'm using APEX 3.0 on Oracle 9i.
I've tried it various ways. No luck..
How can I get this PL/SQL to call a package stored procedure?
TIA
Steve

Steve,
Good that you provided the package code. I believe the problem is that you put double-quotes around the procedure name and signature.
procedure "TESTA(ci_sql in varchar2)" ...So you made the name of your procedure "TESTA(ci_sql in varchar2)", and it takes no parameters.
So when you call it from Apex with parameters, Oracle can't find a procedure simply named TESTA, especially one that accepts a single parameter.
Here's what I wrote:
CREATE OR REPLACE PACKAGE BODY test_apex IS
    PROCEDURE display_line(show_value IN VARCHAR2)
    IS
    BEGIN
        htp.p(show_value);
    END display_line;
END test_apex;I only got to thinking about this because I realized that your procedure was not displaying the value of the parameter you're passing in (as I am above).
For me, putting double-quotes around my procedure names are extraneous. In your case, they're disastrous! ;-)
Good luck,
Stew
My Oracle Community blog:
http://www.oraclecommunity.net/profiles/blog/list?user=stewstryker

Similar Messages

  • Calling a package procedure with Date parameter only

    Hi All,
    Please help me to call a package procedure with Date parameter from sql prompt.
    Arif

    Check the below procedure.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure procdate (p_date_in date)
      2  is
      3  p_date_out date;
      4  begin
      5  p_date_out := add_months(p_date_in,6);
      6  dbms_output.put_line(p_date_out);
      7* end;
    SQL> /
    Procedure created.
    SQL> exec procdate('01-JAN-2010');
    01-JUL-10
    PL/SQL procedure successfully completed.
    SQL> exec procdate(to_date('01/01/2010','DD-MM-YYYY'));
    01-JUL-10
    PL/SQL procedure successfully completed.
    SQL> exec procdate('31-DEC-2010');
    30-JUN-11
    PL/SQL procedure successfully completed.

  • Calling a package.procedure that accepts a type table.

    I'm getting the error "Error(45,20): PLS-00330: invalid use of type name or subtype name" when I run the procedure SP when it calls the d.is_date procedure that accepts a table as the second parameter.
    below is the Abbreviated code for the package.procedures that contain the "is_date".
    I've tried several things and can't seem to get SP to compile.
    thanks.
    create or replace
    PROCEDURE SP AS
    valid_out boolean;
    date_out date;
    date_fmt_out varchar2(30);
    type Mask_Tabtype is
    table of varchar2( 30 )
    index by binary_integer;
    Fmts Mask_Tabtype;
    BEGIN
    Fmts( 1 ) := 'fxDD-MON-RR';
    Fmts( 2 ) := 'fxDD-MON-YYYY';
    Fmts( 3 ) := 'fxDD-MON';
    Fmts( 4 ) := 'fxMM/DD';
    Fmts( 5 ) := 'fxMM/RRRR';
    d.Is_Date( 'test', Mask_Tabtype, Valid_out, Date_out, Date_Fmt_out);
    END SP;
    create or replace package d as
    type Mask_Tabtype is
    table of varchar2( 30 )
    index by binary_integer;
    Fmts Mask_Tabtype;
    Procedure Is_Date( Value_in in varchar2,
    Tab in Mask_Tabtype,
    Valid_out out boolean,
    Date_out out date,
    Date_Fmt_out out varchar2);
    end d;
    create or replace package body d as
    Fmt_Count integer;
    Date_Val date := null;
    Date_Fmt varchar2( 30 ) := 'fxMM/DD/YYYY';
    Procedure Is_Date(value_in in varchar2, Tab In Mask_Tabtype,
    Valid_out out boolean, Date_out out date, Date_Fmt_Out out varchar2)
    is
    begin
    /* Logic here removed to make post smaller
    End Is_date;
    End d;

    Here...
    d.Is_Date( 'test', Mask_Tabtype, Valid_out, Date_out, Date_Fmt_out);you are passing in Mast_Tabtype, which is a type declaration, rather than a variable of that type.
    Try...
    d.Is_Date( 'test', Fmts, Valid_out, Date_out, Date_Fmt_out);

  • Getting error calling a package/procedure from DB

    I'm on 11.1.1.6 and I'm trying to execute a procedure in a package in the DB my ADF application is connected to.  I get the following error  "Could not find saved view state for token".  If I comment out the execution of the method that is calling the procedure the error goes away.  The error shows up under the log for the application on the EM console.  The procedure does not get executed.  Can anyone tell me what it could be?  I am using the tool Oracle provided to gain access to the EBS database without using the apps password.  I wonder if that may be causing the issue?  Can it be related to a security or grant issue of some kind?  The package procedure is under the apps schema.

    Hi,
    I don't think that on this forum we know enough about EBS to be helpful with security privileges. But if you read this here ADF & Weblogic How To: TROUBLESHOOTING: Could not find saved view state for token ...
    then it seems that there are some sort of access problem
    Frank

  • Call to Package Procedure fails with wrong number or type of parameters

    I think its getting to the correct package and procedure since if I change the name slightly, I get an error about it not being defined.
    Here is my Parameter set up:
    OracleParameter[] theParams = new OracleParameter[26];
    theParams[0] = new OracleParameter("P1",OracleDbType.Char,2);
    theParams[1] = new OracleParameter("P2", OracleDbType.Char, 12);
    theParams[2] = new OracleParameter("P3", OracleDbType.Char, 12);
    theParams[3] = new OracleParameter("P4", OracleDbType.Char, 12);
    theParams[4] = new OracleParameter("P5", OracleDbType.Double);
    theParams[5] = new OracleParameter("P6", OracleDbType.Char, 12);
    theParams[6] = new OracleParameter("P7", OracleDbType.Char, 12);
    theParams[7] = new OracleParameter("P8", OracleDbType.Char, 12);
    theParams[8] = new OracleParameter("P9", OracleDbType.Char, 10);
    theParams[9] = new OracleParameter("P10", OracleDbType.Char, 3);
    theParams[10] = new OracleParameter("P11", OracleDbType.Char, 2);
    theParams[11] = new OracleParameter("P12", OracleDbType.Char, 2);
    theParams[12] = new OracleParameter("P13", OracleDbType.Char, 2);
    theParams[13] = new OracleParameter("P14", OracleDbType.Char, 6);
    theParams[14] = new OracleParameter("P15", OracleDbType.Char, 6);
    theParams[15] = new OracleParameter("P16", OracleDbType.Varchar2);
    theParams[16] = new OracleParameter("P17", OracleDbType.Char, 2);
    theParams[17] = new OracleParameter("P18", OracleDbType.Char, 16);
    theParams[17].Direction = System.Data.ParameterDirection.Output;
    theParams[18] = new OracleParameter("P19", OracleDbType.Char, 12);
    theParams[18].Direction = System.Data.ParameterDirection.Output;
    theParams[19] = new OracleParameter("P20", OracleDbType.Varchar2, 12);
    theParams[20] = new OracleParameter("P21", OracleDbType.Varchar2);
    theParams[21] = new OracleParameter("P22", OracleDbType.Char, 2);
    theParams[22] = new OracleParameter("P23", OracleDbType.Char, 2);
    theParams[23] = new OracleParameter("P24", OracleDbType.Char, 2);
    theParams[24] = new OracleParameter("P25", OracleDbType.Char, 2);
    theParams[25] = new OracleParameter("P26", OracleDbType.Char, 2);
    Now the problem is that the package definition is declared using types from database table columns, for the most part.
    So for those, I used the real types of those columns, like for CHAR(2) I used OracleDbType.Char with length 2.
    There are just a few odd balls that I'm not sure about.
    For new OracleParameter("P5", OracleDbType.Double);, this is a parameter defined usijng a column type, that is NUMBER(8). Not sure what to use here.
    For the line theParams[15] = new OracleParameter("P16", OracleDbType.Varchar2);, the parameter definition for the procedure parameter is VARCHAR2. So I used that with no length specified. Is that correct?
    The oddest is this one, theParams[19] = new OracleParameter("P20", OracleDbType.Varchar2, 12);, where the procedure parameter is defined as a type from another package. That in turn is defined as a RECORD:
    TYPE t_log_rec IS RECORD (
    log_seq t_handle -- VARCHAR2(12)
    and t_handle is defined in terms of another table column, and that is defined as VARCHAR2(12).
    Any help on how to map those Oracle types back to .Net Oracle data types and parameter definitions is appreciated.

    PLSQL Record types cannot be passed directly via OCI (read client) apps, and can only be instantiated/passed from other PLSQL procedures.
    You could create a wrapper procedure in the database that accepts all scalar types, which then converts the varchar2 into a t_log_rec and then calls the "real" procedure.
    Or, you could instantiate a t_log_rec inside an anonymous block and call the real procedure via that anonymous block.
    Varchar2 parameters need size defined. When you assign an IN param a value, size is implicitly defined. OUT parameters need to have size explicitly defined.
    Hope it helps
    Greg

  • Unable to compile a package calling a package procedure in different schema

    Hello,
    I'm unable to compile a package referencing a package located in another schema. I get the message: PLS-00201: identifier 'pkg1' must be declared
    Facts:
    0. I'm running Oracle DB 10.2.0.4.0 Enterprise Edition
    1. There is one schema ('schema1') containing a package ('pkg1').
    2. This package 'pkg1' has a public synonym ('pkg1' as well).
    3. The EXECUTE grant is given to a role ('role1').
    4. There is another schema 'schema2', which is granted the role 'role1' (and set as default).
    5. This schema 'schema2' contains a package ('pkg2').
    6. This package 'pkg2' calls a procedure of 'pkg1'.
    7. When compiling 'pkg2', I get error message saying 'pkg1' does not exist.
    Of course, if I execute 'GRANT EXECUTE ON pkg1 TO PUBLIC' or 'GRANT EXECUTE ON pkg1 TO schema2', I can compile the package 'pkg2'. But I don't want this.
    And what's weird is that, connected as 'schema2', I can execute the statement 'execute pkg1.proc1' without any trouble. So I guess the role setup is okay.
    What would let me compile 'pkg2' properly?
    Regards,
    Arnaud

    user3347638 wrote:
    Hello,
    I'm unable to compile a package referencing a package located in another schema. I get the message: PLS-00201: identifier 'pkg1' must be declared
    Facts:
    0. I'm running Oracle DB 10.2.0.4.0 Enterprise Edition
    1. There is one schema ('schema1') containing a package ('pkg1').
    2. This package 'pkg1' has a public synonym ('pkg1' as well).
    3. The EXECUTE grant is given to a role ('role1').
    4. There is another schema 'schema2', which is granted the role 'role1' (and set as default).
    5. This schema 'schema2' contains a package ('pkg2').
    6. This package 'pkg2' calls a procedure of 'pkg1'.
    7. When compiling 'pkg2', I get error message saying 'pkg1' does not exist.
    Of course, if I execute 'GRANT EXECUTE ON pkg1 TO PUBLIC' or 'GRANT EXECUTE ON pkg1 TO schema2', I can compile the package 'pkg2'. But I don't want this.
    And what's weird is that, connected as 'schema2', I can execute the statement 'execute pkg1.proc1' without any trouble. So I guess the role setup is okay.
    What would let me compile 'pkg2' properly?
    Regards,
    Arnaudprivileges acquired via ROLE do NOT apply within named PL/SQL procedures.
    above is just a restriction built into PL/SQL.
    accept it & get on with reality

  • Call Package Procedure from a Servlet?

    Hi,
    Is it possible to call a package procedure from a servlet?
    Art

    Could you be a bit more specific please? I'm not sure where or what to look for.
    Art
    Wrap it with WebServices interface. There is an example article somewhere on otn.oracle.com

  • Error while accessing oracle packaged procedure in crystal report./ How to

    Hi,
    When i tried to call a packaged procedure in crystal reports for .net, i am unable to access it.
    i am getting error as 'unknown query engine'
    In that packaged procedure i have a two IN parameters and one OUT TABLE parameter ( which is declared in package specification )
    And when selecting the packaged procedure in crystal report,the wizard shows all the parameters like the IN parameters, and when i just leave it blank. i unable to set into report.
    ie., the OUT table type is shown as IN paramters (Actually it is an output and has field fields in it.)
    And No fields are coming in the Fields Explorer of crystal reports in .net.
    can you provide any help.
    thanks and regards
    Mohan Raj K.
    Actually using vs.net 2005 prof.
    Message was edited by:
    mohanraj_k

    Actually the OUT Parameter type in the stored
    procedure is showing as IN Parameters and asking
    for input values in the crystal report creation
    wizard(while selecting the
    database,connection,storedprocedures/qualifiers).That sounds like a problem on the .net / crystal report creation wizard side of things. Oracle no doubt recognises them as OUT parameters, so it's not Oracle at fault. I would guess the .net stuff is just querying the data dictionary to see what parameters there are rather than differentiating between the INs and OUTs.

  • How to see the packaged procedures in form builder?

    Hi Experts,
    I have a oarcle apps form in form builder.
    When i want to see the code behind the trigger when pressed button do ,i see that it calls a packaged procedure like
    oksaudet_header.when_button_pressed(p_item => 'STOP_BUTTON');
    I want to see beyond this ,so how to find out this package procedure oksaudet_header.when_button_pressed?
    if its any pll ,how do i know which pll will have this package?
    Thanks

    Hi,
    You just need to search for component OKSAUDET_HEADER in Forms Builder (use the 'Find' button). It will take you to the package, and above it you will find the attached library that contains it (if it's an attached library).
    Hope it helps.

  • Package Procedure

    Problem calling a package procedure with default values within oracle forms 6i. It appears that
    oralce forms 6i does not support calls to package procedure with default values.
    Any ideas why???
    Much appreciated.

    There are no gobal variables within the package. It's actually the package procedures that use default values.
    These package procedure are being called from different calling environments and I want to avoid overloading the procedures.
    So if I set the parameters that are not used by forms6i to default values, I'd have hoped it worked but it didn't.

  • Call a Package in another schema  from a Trigger?

    Is there a method to call a package procedure from a trigger when the package exists within a different schema than the trigger (table)?
    Do you need a dblink to execute a procedure in a different schema within the same database?

    Hello,
    you need execute prvilege given to target schema on source package and you can create synonym in target schema as well. And you don't need dblink if the procedure resides in same schema or different schema in same database
    CREATE OR REPLACE TRIGGER myschema.test_trg
       BEFORE INSERT OR DELETE OR UPDATE
       ON test_table
       REFERENCING NEW AS new OLD AS old
       FOR EACH ROW
    DECLARE
    BEGIN
       -- How to pass parameters
       otherschema.mypkg.myproc (:new.id, :new.code);
    END;
    /Regards

  • Calling a stored procedure within a package

    We have a number of packages containing stored procedures. In an existing production application, we used embedded SQL in C programs to call these stored procs
    e.g.
    EXEC SQL EXECUTE
    BEGIN owner.fees_calc.some_fee(:parm1,...);
    END;
    END-EXEC;
    Now, I am trying to use SQLJ to call this same stored proc in the package. However, I am getting a compilation error from sqlj saying that it cannot find a stored procedure or function of that name. It works fine if I use a stored proc that is not in a package.
    So how do I call a stored procedure within a package? Or is this not currently possible with sqlj?
    I am also getting a warning just before the error and I'm wondering if the error is being caused by this:
    Warning: You are using an Oracle JDBC driver, but connecting to a non-Oracle database. SQLJ will perform JDBC-generic SQL checking.
    I am connecting to an Oracle 7.3.3 database using an Oracle 7.3.4 JDBC driver. I also tried using the Oracle 8.0.5 JDBC driver for the same database but I get the same warning message.

    I used the following code to call a stored
    procedure via SQLJ:
    try {
    #sql [iCtx] {
    CALL ibs.cvs_validate.validate_port_id(:IN record_id ,:IN poe_pod_flag,:IN port_id,:OUT error_code,:OUT error_message) };
    where
    "ibs" is the schema
    "cvs_validate" is the package
    "validate_port_id" is the procedure
    The code runs fine, but to get it to compile
    in JDeveloper 2.0, I had to disable the "Check SQL semantics against database schema" option on the Project Properties (SQLJ) property sheet.
    null

  • Error when calling a stored procedure from a SQL Script

    Apologies if this is a really dumb question but I can't seem to call a procedure in package from a SQL script. I have a simple package.procedure containing a loop to populate a table. I would like to include a call to this procedure from my database install script, that also includes my CREATE and INSERT statements. I run the script using "@install_databae" and the CREATE and INSERT statements run fine. The script gives an error when it reaches the line below:
    exec lazarus.PopulateGridPositions;
    and gives the error.....
    BEGIN lazarus.PopulateGridPositions; END;
    ERROR at line 1:
    ORA-04063: package body "LAZARUS.LAZARUS" has errors
    ORA-06508: PL/SQL: could not find program unit being called: "LAZARUS.LAZARUS"
    ORA-06512: at line 1
    The procedure and package have both compiled without errors and the statement on its own works fine in SQL*Plus.
    I've obviously missed some fundamental concept with scripts and SQL. Please can anybody help me?

    Histon FTM wrote:
    ORA-04063: package body "LAZARUS.LAZARUS" has errors Above, obviously conflicts with the statement that follows:
    >
    The procedure and package have both compiled without errors and the statement on its own works fine in SQL*Plus.I suggest you take a look in the USER_ERRORS view to see, what the errors are.
    And just checking:
    You have schema called LAZARUS, which holds a package named LAZARUS, which holds a procedure called POPULATEGRIDPOSITIONS?
    Edited by: Toon Koppelaars on Oct 1, 2009 5:55 PM

  • Calling the package dynamically inside a procedure

    HI
    i have table which contains contains package name, procedurename,input parameters and output parameters as columns like below.
    Table name is PKG_META_DATA.
    package_name Procedure_name input parameters output parameters
    pkg1 prc1 i_location,i_type o_date
    pkg2 prc3 i_location o_date ,o_prev_date
    Note:Input parameters and output parameters will vary according to package
    Now i need to write a procedure which calls package dynamically and display the output values.
    i have tried it in this way but it it is not working.please help
    declare
    l_text varchar2(1000);
    cursor c1 is select package_name,Procedure_name,input parameters,output parameters from pkg_meta_date;
    begin
    for cur in c1 loop
    execute immediate 'begin '||package_name||'.'||Procedure_name||'('||input parameters ||output parameters||');'
    --display output values from a package
    dbms_output.put_line( o_date );
    dbms_output.put_line( o_prev_date );
    end loop;
    end;

    user12057782 wrote:
    Now i need to write a procedure which calls package dynamically and display the output values.Why do such a silly and stupid thing? Do you have technical justification for wanting to call code dynamically?
    And if you reallly and truly need to use dynamic PL/SQL calls, then using bind variables is mandatory. Unless you want to fragment and trash the shared pool and waste a lot of CPU by burning it on hard parsing.
    This also means that execute immediate is the wrong choice. (it does not support dynamic binding)
    And if I foam a bit at the mouth with this response - simply that I'm getting utterly frustrated seeing yet again dynamic SQL being (ab)used, without the foggiest notion of how to do so correctly, and with complete ignorance of the repercussions on security and performance.
    Dynamic coding is NOT the best thing since slice bread. It was never even a consideration as a being better choice.
    What it is, is wrong - 99% of the time. Wrong ito design. Wrong for security. Wrong for performance. Wrong for flexibility.

  • Calling SSIS package in Stored Procedure...

    I have a SSIS package, and i want to call this (run this SSIS package) from Stored Procedure in Sql Server 2008.
    Can anyone  please explain to me as to how can i call SSIS package from SP?
    Thanks!
    Rahman

    Ted Kruger explains how this can be done in his blog post
    Run SSIS Package from Stored Procedure
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog

Maybe you are looking for

  • Installation flashplayer with windows 8.1 and IE 11 does not work

    I have installed Windows 8.1 64 Bit and i am using IE 11 and flasplayer version 11.9.900.170. All updates from Microsoft are installed. Flashplayer videos are not displayed. If i switch to compatiblity mode in IE 11, the videos are displayed correct.

  • Incoming payment without Customer

    hi, May I know how to enter incoming payment without customer, and knock off the payment with an invoice later on? Thank you.. Regards, Catea k

  • Click a button to change the Master Page

    Hi everybody, I have a LiveCycle Designer question- Is it possible to have a button onclick event to change the Pagination "Place" property of a subform?  I would like to change the Master Page that a subform is placed on using a script on an onclick

  • I need a zoom lens for shooting sports morning and night

    I need someone to help me selecting a telephoto zoom that will help me to get sharp zoom images for football matches morning and night time. I have a Canon 50 D and normal Canon 55-250 IS zoom also I have Canon EF 50  f/1.8 II lens in addition to Can

  • Why does my iPad 2 keeps freezing .. ?

    My iPad keeps freezing ... What I do need to  do to correct this problem?