Package procedure arguments error using table of

Hi ,
I have the following definition for my package
CREATE OR REPLACE package a_test_pkg as
type a_type is table of varchar2(10) index by binary_integer;
procedure a_proc (name in a_type);
end;
CREATE OR REPLACE package body a_test_pkg as
procedure a_proc (name in a_type)
as
begin
dbms_output.put_line('Hello');
end;
end;
when i am trying to execute it using
begin
a_test_pkg.a_proc(name=>'hello');
end;
why am I getting errors?

You are getting errors because 'Hello' is not a a_test_pkg.a_type type variable, it is a VARCHAR2.
You need to call the procedure more like:
SQL> DECLARE
  2     l_t a_test_pkg.a_type;
  3  BEGIN
  4     l_t(1) := 'Hello';
  5     a_test_pkg.a_proc(l_t);
  6  END;
  7  /
Hello
PL/SQL procedure successfully completed.You can only call a PL/SQL type (the INDEX BY makes it a PL/SQL type) from within PL/SQL.
HTH
John

Similar Messages

  • Error using TABLES

    I am using Logical database PNPCE in HR for my report.
    To get the selection screen of the LDB in my report program i need to give the statement
    TABLES : PERNR.
    But using this is giving me EPC error that TABLES should not be used.
    If i take out TABLES : PERNR.
    I am not getting the slection screen of LDB for my report.plz give me a solution.
    Thank You,
    Phani.

    Try using the below statement
    NODES: PERNR.
    Hope this helps.
    Thanks,
    Balaji

  • Ability to filter out Views, Indexes, Packages, Procedures, Functions, etc.

    Under Connections, I choose my database, then the user, and from there I view my Tables. I have no need to view Views, Indexes, Packages, Procedures, etc., just the tables (which I am able to filter).
    Since the tree containing Views, Indexes, Packages, etc., take up a lot of real estate (I work with multiple databases, each with a specific user, or schema), is it not possible to filter these out?
    Thanks!
    Edited by: user9956988 on Jun 15, 2010 3:53 PM

    Just to double check that I'm interpreting the problem correctly, is the following true:
    select * from all_objects where object_name = 'DBA_SOURCE'
    returns nothing
    select * from dba_source where name = your PL/SQL module
    returns all the code

  • "Invalid argument" error when attempting to use Linked Table Manager

    I am trying to import a text file into a linked table in Access (the linked table resides in SQL Server). I run through the import wizard which always ends with an 'Invalid Argument' error and claims the import was unsuccessful but when I query the table
    all the data has been imported. How do I get this error to stop?
    Any suggestion will be appreciated

    Sounds like something is not hooked up right, or setup right.  Can you do a Compact and Repair and try again?
    http://www.fmsinc.com/Microsoftaccess/compact/compact-on-close.html
    http://www.databasedev.co.uk/compacting-and-repairing-ms-access.html
    C & R is really done to defragment a DB, but it can 'fix' other things as well.
    Also, see this.
    http://www.solvexia.com/help/workingwithaccessfiles/how-to-import-data-from-text-file-to-access-table/
    http://www.databasejournal.com/features/msaccess/article.php/3853531/Working-with-external-text-files-in-MS-Access.htm
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • No argument of type TABLE frm-10764 error

    I'm trying to base a data block on a procedure. When I use a cursor ref there is no problem, however when I use a table I get the error no argument of type TABLE or REFCURSOR (frm-10764). In the package I have defined a table and I use an in out variable of the table type defined. In the block I reference the package.procedure and I get the above message. Can any one tell me what I'm doing wrong??
    Thanks
    Simon

    Hello,
    If i understood u guys correctly then here is example and it is working perfectly with F5.0 & O8.0. May be u will find some un-necessary code. pl. ingore it.
    Step1- Create a stored Package Specification with declaration of ur REF Cursor.
    package plsql_tab IS
    --Declare REF Cursor Type
    type plsql_refcur is ref cursor;
    end plsql_tab;
    Step2- Create ur own stored procedure and pass REF cursor as an argument.
    procedure proc1
    (p_cur in plsql_tab.plsql_refcur)
    is
    k pls_integer := 0;
    var1 number;
    var2 varchar2(50);
    begin
    loop
    fetch p_cur into var1, var2;
    exit when k>=10 or p_cur%notfound;
    insert into plsq_tbl values
    (k,'In Proc1 : '| |var2);
    dbms_output.put_line('In Proc1 : '| |var2);
    end loop;
    close p_cur;
    end;
    Step3- Create a form, write form procedure like below and then call this procedure on WHEN-Button-Press or anywhere u needed.
    procedure proc2 is
    --declare REF Cursor
    cur_plsql plsql_tab.plsql_refcur;
    begin
    --Open REF Cursor for a given Qry
    open cur_plsql for select * from plsq_tbl
    where rownum < 10;
    --Pass REF Cursor as an IN Parameter
    proc1(cur_plsql);
    --Close REF Cursor
    close cur_plsql;
    end;
    Hope it will help u.
    Thanks & Regards,
    Anil

  • Error While Creating Block on Package Procedure

    Hi
    When I try to create a block on a package Procedure I get the following error
    ifbld60.exe has generated errors and will be closed by Windows.
    You will need to restart the program.
    An Error log is being created,
    and forms closes.
    Is it something to do with Forms problem or with Windows? Is there a patch available for this problem or its a OS bug. The client I am testing this form from is Windows 2000 Professional.
    Thanks for your help
    Diogo

    Hi
    You cannot directly insert object in Stored Procedure universe,Whatever object you are using to define your derived table,you have to include all those objects into the universe first.
    From the below image you can see that i have 3 derived tables ,but whatever objects i am trying to use all those i have inserted into the universe.
    Try to build like this save and export.
    Let me know if you face nay error

  • 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.

  • 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);

  • Select from sys table in package procedure

    Is it possible to use a table in the SYS schema in a procedure defined in a package?
    Right now, these errors are raised:
    SQL> SHOW ERRORS PACKAGE BODY App_security_context;
    Errors for PACKAGE BODY APP_SECURITY_CONTEXT:
    LINE/COL ERROR
    17/3 PL/SQL: SQL Statement ignored
    18/8 PLS-00201: identifier 'SYS.DBA_ROLE_PRIVS' must be declared
    eg)
    CREATE OR REPLACE PACKAGE App_security_context IS
         PROCEDURE Set_restrictions;
    END App_security_context;
    CREATE OR REPLACE PACKAGE BODY App_security_context IS
    PROCEDURE Set_restrictions
    IS
    data_code VARCHAR2(16);
    BEGIN
    SELECT MD_SYS_USER_DATA_CODE.code_id INTO data_code
    FROM
    MD_SYS_USER_DATA_CODE
    , SYS.DBA_ROLE_PRIVS
    WHERE SYS.DBA_ROLE_PRIVS.grantee = SYS_CONTEXT('USERENV', 'SESSION_USER')
    AND SYS.DBA_ROLE_PRIVS.granted_role = MD_SYS_USER_DATA_CODE.role_id;
    DBMS_SESSION.SET_CONTEXT('app_entry', 'data_code', data_code);
    END Set_restrictions;
    END App_security_context;

    You need the select grant on the SYS view granted directly to you - not through a role. See here for more details:
    http://osi.oracle.com/~tkyte/Misc/RolesAndProcedures.html

  • 942: error when trying to browse/refresh Packages, Procedures and Functions

    Hi,
    I'm using OSD 1.1 against 10g.
    I can create and compile functions in a certain schema but when I try to browse the Functions node I get "ORA-00942: table or view does not exist." and the node does not expand.
    The same thing happens with the Packages and Procedures nodes.
    Does anyone have any ideas?
    Thanks in advance
    Mike

    I've got the same problem with SQL Developer 1.1.0.23.64 against 9.2.0.4.0 and 10.1.0.4.0. This error occured only for a few package/procedure/function owners. I've found that these owners have SELECT ANY TABLE system privilege. In such case SQL Developer generates following SELECT:
    SELECT OBJECT_NAME, OBJECT_ID, DECODE(STATUS, 'INVALID', 'TRUE', 'FALSE') INVALID, 'TRUE' runnable, NVL( b.HAS_BODY, 'FALSE') HAS_BODY
    FROM SYS.DBA_OBJECTS a,
    (SELECT 'TRUE' HAS_BODY, object_name tmp_name FROM SYS.DBA_OBJECTS WHERE OWNER = :SCHEMA AND OBJECT_TYPE = 'PACKAGE BODY') b
    WHERE OWNER = :SCHEMA
    AND OBJECT_TYPE = 'PACKAGE'
    AND object_name = tmp_name (+)
    AND SUBOBJECT_NAME IS NULL
    AND OBJECT_ID NOT IN ( SELECT PURGE_OBJECT FROM RECYCLEBIN )
    Otherwise it generates
    SELECT OBJECT_NAME, OBJECT_ID, DECODE(STATUS, 'INVALID', 'TRUE', 'FALSE') INVALID, 'TRUE' runnable, NVL( b.HAS_BODY, 'FALSE') HAS_BODY
    FROM SYS.ALL_OBJECTS a,
    (SELECT 'TRUE' HAS_BODY, object_name tmp_name FROM SYS.ALL_OBJECTS WHERE OWNER = :SCHEMA AND OBJECT_TYPE = 'PACKAGE BODY') b
    WHERE OWNER = :SCHEMA
    AND OBJECT_TYPE = 'PACKAGE'
    AND object_name = tmp_name (+)
    AND SUBOBJECT_NAME IS NULL
    AND OBJECT_ID NOT IN ( SELECT PURGE_OBJECT FROM RECYCLEBIN )
    Both for 10g.
    So you could try to grant SELECT on DBA_OBJECTS to owner of your functions.
    I don't know why SQL Developer doesn't SELECT from ALL_OBJECTS in all cases.
    Jiri
    Message was edited by:
    Jiri Suchy
    You will need grant SELECT on DBA_SOURCE, too.

  • Get error messages for those procedures in some system tables

    Hi expert,
    when I ran a procedure by schedule or on the front end. is there any approach to get error messages for those procedures in some system tables?
    Many Thanks,

    >
    when I ran a procedure by schedule or on the front end. is there any approach to get error messages for those procedures in some system tables?
    >
    No - there is no system log table.
    You need to create your own logging package and log table and modify your procedure code to call your own logging procedures to log into your own log table.
    The procedures in the log package would typically be defined with PRAGMA AUTONOMOUS_TRANSACTION so that the exceptions get logged even if your procedure performs a ROLLBACK.
    See AUTONOMOUS_TRANSACTION in the PL/SQL Language Reference
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/autotransaction_pragma.htm
    Here is an Oracle-Base article that shows how to use the pragma to perform logging.
    http://www.oracle-base.com/articles/misc/autonomous-transactions.php

  • Error Executing Oracle Package/Procedure

    I'm having trouble executing a procedure in a package of mine. I have a package in one schema I'm trying to execute it with a different ID (i.e. User1 in trying to execute a procedure in User2's Schema). The permissions look fine (Execute has been granted), but when I try to exec the procedure using "Schema.Package.Procedure" format, I get a "component 'PackageName' must be declared" error. If I create a Public Synonym for my package and exec my Procedure, dropping the Schema Prefix ("Package.Procedure"), it executes fine. To make things even more interesting, I recreated the packages in a third Schema and executedfine with the Schema prefix ("Schema.Package.Procedure").
    The only difference (I see) between the two schemas is the use of an "underscore" in the name: (for example) Schema1 and Schema_Two. Put the package in Schema1 and it runs fine. Put it in Schema_Two and it errors when fully qualified with the Schema name.
    Does Oracle have a problem running packages when the Owner Schema has an underscore in the name? Or am I missing some other potential problem(s)?
    Thanks in advance...

    355099: I do have another copy of this procedure in another Schema. I'll try dropping that other version.
    Mark: We have a schema for our data/logic and an ID we created for the web (so we don't access our data using our Schema Owner ID). The web ID is granted Select authority to Tables and Execute authority to Packages. We use this technique in other applications and it works fine. Those permissions have been set here but we still have the issue. I'll keep digging around. I'm sure it's something minor we are overlooking.
    Thanks for you replies...

  • 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 &amp;amp; Weblogic How To: TROUBLESHOOTING: Could not find saved view state for token ...
    then it seems that there are some sort of access problem
    Frank

  • Procedure based blocks - error using Forms 6/8i/NT

    A simple form with a procedure-based block fails with the Lock procedure, giving an ORA-03114 error. I believe there is some known bug with procedure-based blocks using Forms 6 and Oracle 8i over NT. The Query procedure (based on a ref cursor) works fine, but the Lock, Insert and Delete triggers (and presumably the Update trigger too - without a Lock I can't get that far) return the error (these are based on a table).
    Does anyone know if this is a known bug? The same form has run successfully using Forms 6/Oracle 7.3/VMS.

    It's a known bug and the patch is available through MetaLink.

  • Bex Designer 3.5: An unexpected 'invalid procedure call or argument' error

    Hi,
    Our Bex environment has both 3.5 and 7.0 queries and objects.
    Recently Bex Query Designer 3.5 started crashing when we expand on the Restricted Key Figures. It works fine in 7.0 designer. And, expanding the Calculated Key Figures works fine in both 3.5 and 7.0
    It only happens on 1 multiprovider, which has more than 100 RKFs.
    The error message is: An unexpected 'invalid procedure call or argument' error occured in wdbrlog.
    On clicking Continue, the next message is: Run-time error '-2147221499 (80040005)'; Fatal Error - Terminating
    The same error is happening in Test, UAT and Production environments for this 1 multiprovider.
    I resinstalled Business Explorer client software, but no change.
    Any suggestions on how to fix or approach fixing this?
    Thanks!

    Problem was resolved by opening a note with SAP. Their response is pasted below:
    "The problem has been solved. The reason for the termination in Query Designer was actually the fact the one Restricted Key Figure somehow has lost it's technical name.
    The problematic object is RKF SAP Plan Value (4L9J85WYTCFK4DEA63PD2R4V7)The user given name of this object was not available in the database table RSZCOMPDIR and was actually required in the Query Designer. The application was not able to create a tree of expanded RKFs having no technical names.
    In general, this error can be fixed by the special check program analyze_rsz_tables which is supposed to try to find out this missing technical name. But in this particular case the repair procedure in the program has failed as no traces or information what this missing name could be was available. Therefore I just fixed this issue manually by entering a new technical name for this object."

Maybe you are looking for

  • Service Dpt. got troubles repairing my mac and give me alternative options.. What option should I choose? Help!

    I got a MacBookPro few months ago (October 2011)                    17-inch, Early 2011 Processor  2.2 GHz Intel Core i7 Memory     4 GB 1333 MHz DDR3 Graphics   AMD Radeon HD 6750M 1024 MB Software   Mac OS X Lion 10.7.4 But for multiple issues I ha

  • Java Applets font rendering with no AA

    So I've exhausted all possibilities on my end here and have no idea how to get anti aliasing to work with java applets. I've followed all of the suggestions from the wiki entry for the subject here: https://wiki.archlinux.org/index.php/Ja - ment_Font

  • Email alerts in LMS 4.0

    Hi, I want to implement email based alerts like for interface down, node down in LMS 4.0. Kindly provide complete procedure/steps how to implement this in LMS. Looking forward for a quick reply from your side. Thanks & regards, Majid Saeed 

  • Portal exception error recieved when using StringBuffer

    Hello I have created a portal service. I need to use StringBuffer or StringBuilder class as i do some text concatenation. Since the String is very resource intensive, this is the only best solution. But when i try to append a text to stringbuffer var

  • WCS report to show duplex on associated AP's

    Is there a report that I can run in WCS to show me the speed and duplex that my AP's are operating at?