Unable to execute packaged procedure in PLSQL

DECLARE
CURSOR c1
IS
SELECT NAME
FROM v$hm_check
WHERE internal_check = 'N' AND NAME NOT LIKE '%ASM%';
sql_text VARCHAR2 (2000) := NULL;
random_value VARCHAR2 (50);
BEGIN
FOR hm_check IN c1
LOOP
random_value := dbms_random.string('U', 20);
sql_text :=
'dbms_hm.run_check('''
|| hm_check.NAME
|| ''','''
|| random_value
|| ''',null,null);';
DBMS_OUTPUT.put_line (sql_text);
EXECUTE IMMEDIATE (' begin ' || sql_text || ' end; ');
END LOOP;
END;
Error at line 4
ORA-48615: Parameter [CF_BL_NUM] value not specified
ORA-06512: at "SYS.DBMS_HM", line 191
ORA-06512: at line 1
ORA-06512: at line 24
if i exeucte commenting execute immediate then i will be able.. but i want to execute with execute immediate...
can you please help out.. thanks...

knowledgespring wrote:
I changed the code
sql_text:='begin '||sql_text|| ' end;';
in the given procedure
it generates
begin dbms_hm.run_check('DB Structure Integrity Check','NUCQGGPVQLVJELKJMMGW',null,null); end;
begin dbms_hm.run_check('CF Block Integrity Check','SYWCMEEPBLYNNQCAQAHV',null,null); end;
begin dbms_hm.run_check('Data Block Integrity Check','KILLVEYBLEVVEVLAYGGI',null,null); end;
begin dbms_hm.run_check('Redo Integrity Check','ROJDCYKULSFWURHNCUDY',null,null); end;
begin dbms_hm.run_check('Transaction Integrity Check','IZLGHJOLXJIIORYMGVFG',null,null); end;
begin dbms_hm.run_check('Undo Segment Integrity Check','WDXGWDIHQPYHGROYYXOA',null,null); end;
begin dbms_hm.run_check('Dictionary Integrity Check','HTCZJEIBMNTZYBEECTNX',null,null); end;
can i execute this one by one??
I see first one is executed but not the second one or next one...? is there any other way of executing this one time..when all else fails, Read The Fine Manual
http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_hm.htm#CHDGBEBD
"SELECT name FROM V$HM_CHECK WHERE INTERNAL_CHECK = 'N'
Above retrieves the list of checks that can be run manually by users."

Similar Messages

  • Help: Unable to execute a procedure

    Hello Folks,
    Am having a procedure and am trying to execute the procedure in the querytool of sql server. Somehow its returning back with an error.
    I have no clue where am going wrong. Please advice if anyone has any idea.Thanks
    execute process_040_series(01-OCT-09,31-OCT-09)
    its returning Msg 170, Level 15, State 1
    Line 1: Incorrect syntax near '01'.
    /*for refernce this is the code behind procedure */
    CREATE PROCEDURE process_040_series (@start_date     smalldatetime = null ,
                             @end_date       smalldatetime = null, 
                                         @rep_no_in      int = null,
                             @client_code_in char(20) = null,
                             @p_bimonth      int = 0)

    Oops, missed SQL Server thing. You are on erong forum. Anyway, to execute it in SQL Server use:
    execute process_040_series '01-OCT-09','31-OCT-09'SY.

  • Unable to execute a procedure via an odbc dsn

    Hi forum,
    I'm facing an unique problem.
    When I execute a procedure (through sql advantage) that has a call to another procedure on a remote server, it works fine.But when I connect to sybase server via an ODBC or OLEDB dsn, it displays a message as "Login to site '%S_SRVID' failed". The connection works perfect when i execute other procedures that do not have a call to any remote procedure.
    If anybody can help...

    Oops, missed SQL Server thing. You are on erong forum. Anyway, to execute it in SQL Server use:
    execute process_040_series '01-OCT-09','31-OCT-09'SY.

  • Unable to Execute Packages using Agent

    Hi,
    When i am trying to run packages using Agent which is situated on other machine it is giving the following error.
    *" unable to executethe selected logical agent is not assosciated to a physical agent in desired context."*
    java.util.NoSuchElementException
         at java.util.AbstractList$Itr.next(AbstractList.java:350)
         at com.sunopsis.graphical.dialog.SnpsDialogExecution.getAgent(SnpsDialogExecution.java:1436)
         at com.sunopsis.graphical.dialog.SnpsDialogExecution.doScenarioExecuter(SnpsDialogExecution.java:1104)
         at oracle.odi.ui.action.SnpsPopupActionExecuteHandler.actionPerformed(SnpsPopupActionExecuteHandler.java:64)
         at oracle.odi.ui.SnpsActionControler.handleEvent(SnpsActionControler.java:75)
         at oracle.ide.controller.IdeAction.performAction(IdeAction.java:529)
         at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:884)
         at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:501)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
         at java.awt.Component.processMouseEvent(Component.java:6267)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6032)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4630)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4460)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4460)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    Hi mahesh,
    check your agent with test connection, and have a look on your context while executing time it asks context and agent.
    if u have various agents and contexts please choice correct logical agent name related to context...
    in this case also you not able to find solution, then got to topology manager--->go to logical architecture and open your agent, see your logical agent name in different contexts,please check like this under physical schema window in contexts also.
    Regards,
    surya.

  • Executing package & procedure

    I currently have a package and procedure created that I want to use. Yet when I run my script I am getting back an error. Here is the script:
    spool testlog.txt
    set pagesize 0
    set linesize 2048
    set heading off
    set feedback off
    set serveroutput off
    begin
    pin_arch.move_to_staging_for_bkp(1);
    end;
    spool off
    Yet when I execute this I get the following error:
    begin
    ERROR at line 1:
    ORA-20000: Fatal error -- Exiting. See audit trail for details
    ORA-06512: at "PIN_ARCHIVE.PIN_ARCH", line 912
    ORA-06512: at line 2
    Any ideas on why I might be getting this. Thank you in advance.

    Can you paste your package / function here as well.
    thanks
    SH

  • Execute stored procedure from DOS or Unix Shell

    Hi, need ur help again,
    How to execute the stored procedure from DOS or Unix Shell?
    Thanks!

    sqlplus -s /NOLOG @your_sql_script.sql
    -- your_sql_script.sql :
    connect user/password@connect_string
    execute package.procedure (param1, param2, ...) -- for packages
    execute procedure (param1,...) -- for procedures
    exit ;this way you won't advertise your user/password on unix systems

  • Error while executing a procedure in Package

    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package "PLLODS.LK" has been invalidated
    ORA-04065: not executed, altered or dropped package "PLLODS.LK"
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at line 1Why did this error arise when I changed a package and recompiled?

    This errors occurs when a package was executed in session A, compiled in session B, and then executed again in session A. The package executed in session A is in Oracle buffer, but its definition was changed in session B (which session A is unaware of). Now session A uses the old definition of the package but Oracle checks what is in buffer to the new definition and finds a difference. Therefore, it generates an error:
    ORA-04068: existing state of packages has been discarded
    and other related errors.
    Just execute the procedure (in the package) again and you should not see the error again.
    Make sure the stae of the package is valid, that is, when it was recompiled, the package compiled successfully.
    Shakti
    http://www.impact-sol.com
    Developers of Guggi Oracle - Tool for Developers and DBAs

  • Executing A Procedure In a Package Using DBLink

    I need to execute a procedure which is residing in a package using dblink.
    The package got a execute PUBLIC grant.
    When I execute the following statement, I am getting error ORA: 00904, Invalid Identifier
    select PKG_NAME.PROCEDURE_NAME@dblink(null,null,null,null,null,null,null,null,null,null,null) from dual
    How can I execute the above statement.
    Thanks in advance

    I have a database INLABNEW in that i have done this
    SQL> create table temp(no number)
      2  /
    Table created.
    SQL> create or replace package pkg
      2  as
      3     procedure p;
      4  end;
      5  /
    Package created.
    SQL>  create or replace package body pkg
      2   as
      3      procedure p
      4      is
      5      begin
      6             insert into temp values(1);
      7      end;
      8   end;
      9  /
    Package body created.
    SQL> select * from temp
      2  /
    no rows selectedNow i executed the procedure pkg.p from another database
    SQL> exec pkg.p@to_inlabnew
    PL/SQL procedure successfully completed.
    SQL> commit
      2  /And i query the table tmp in INLABNEW
    SQL> select * from temp
      2  /
            NO
             1Now question is have you given your procedure name properly.
    as your procedure is in a package it should be Your_package_name.Your_procedure_name@Your_db_link

  • Executing a procedure in package

    Hi,
    How to execute a procedure in a package? Below is the package
    CREATE OR REPLACE PACKAGE BODY POPULATE_GLTD_TABLES
    IS
    -- LOCAL VARIABLES
    val1 VARCHAR2(10);
    -- Create some job objects:
    v_job1_str VARCHAR2(4000) ;
    v_job1 XXMCK.XXMCK_JOB_OT;
    PROCEDURE populate_gltd_tabs1
    IS
    BEGIN
    dbms_output.put_line('Get_status=> v_job1: ');
    val1:= F_CHECK_GLTD_RECORD_EXISTS('MCK_GLTD_1');
    IF val1 != 'S' THEN
    -- Include message details value - TRUE if yes and FALSE if no
    xxmck.mck_write_log_msg.set_msg_tail(TRUE);
    xxmck.mck_write_log_msg.purge('GLTD-TASK1');
    -- set context will define the source as well as inserts data into cont exit table
    xxmck.mck_write_log_msg.set_context(v_parent_program,v_prog_desc,'GLTD-TASK1');
    xxmck.mck_write_log_msg.log(v_parent_program,'Entering in LOAD_GLTD_TABLES.populate_gltd_tabs1 ','prg','GLTD-TASK1',1);
    xxmck.mck_write_log_msg.log_tail(v_parent_program,'Entering in LOAD_GLTD_TABLES.populate_gltd_tabs1 ','prg','GLTD-TASK1');
    v_job1_str := 'XXCOGNOS.LOAD_GLTD_TABLES.populate_gltd_tabs1;';
    v_job1 := NEW XXMCK.XXMCK_JOB_OT('GLTD-TASK1', v_job1_str, 'Background job test: LOAD_GLTD_TABLES.populate_gltd_tabs1', INTERVAL '60' SECOND);
    v_job1.PRINT(); -- Display basic info about the job
    v_job1.SUBMIT(); -- Submit in background
    v_job1.WAIT();
    v_job1.PRINT();
    v_job1.get_status(v_code, v_message);
    dbms_output.put_line('Get_status=> v_job1: ' || v_code || ':' || v_message);
    -- SELECT DECODE(cont_exit, 'cont', 'cont', 'err', 'err', 'cont') INTO v_result from MCK_LOG_CONT_EXIT_CHK WHERE source = 'GLTD-TASK1';
    --IF v_result = 'err' THEN
    -- raise_application_error(-20000,'Program Aborted');
    --END IF;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN NULL;
    END populate_gltd_tabs1;
    PROCEDURE mainproc
    IS
    BEGIN
    populate_gltd_tabs1; -- CALL TO POPULATE mck_gltd_1 TABLE
    -- Mailing
    xxmck.mck_write_log_msg.send_mail( p_source_prg => v_parent_program
    ,p_source => 'GLTD-TASK1'
    ,p_msg_type => 'prg'
    ,p_from => '[email protected]'
    ,p_to => '[email protected]'
    ,p_server => 'mailhub.mckinsey.com'
    EXCEPTION
    WHEN OTHERS THEN NULL;
    END mainproc;
    END POPULATE_GLTD_TABLES;
    And below is my anonymous block to execute above package
    BEGIN
    POPULATE_MCK_GLTDFILE.mainproc;
    EXCEPTION -- exception handler begin
    WHEN OTHERS THEN NULL;
    END;
    I am trying to run above code in toad. But i am getting error as: identifier 'POPULATE_MCK_GLTDFILE.mainproc' must be declared.
    There are no parameters to be passed.
    The package is compiled successfully.
    I think this must be simplest question any one can I ask, but I cant figure out the solution.
    Please help,
    Aditya

    First remove the horrible exception handler(s) which are hiding all errors;
    ie the
    when others
    then
    null;
    end;Then remember the main syntax is
    begin
    packagename.procedurename;
    end;
    /But also remember that procedure name must be declared in the package header if you want to call it. (This is called a public procedure). A private procedure does not have to be declared in the package header and can only be called from within the same package body.
    I always use sqlplus for verification as that is delivered with oracle. You know if it works with sqlplus it will work with any othere client and if it does not, it's usually a client issue.
    from what you have posted, There is nothing obvious as to why it won't work.

  • SSIS package fails when it is executed by procedure (2008)

    Hi there,
    I have a very anoying problem with SSIS. I've done new packages into same project, almost identical compared to old ones. They work well in visual studio, but I can't execute them using procedure. Old packages works just fine, but none of the new. Error
    message is in the end of my story.
    Visual Studio version is 9.0.30729.1 and SQL Server version is 10.0.4000.0. Is it possible, that these not not updated versions could cause this problem?
    Package ProtectionLevel is DonSaveSensitive.
    Br,
    Ville
    Error messages, when package is executed by procedure:
    Microsoft (R) SQL Server Execute Package Utility
    Version 10.50.1600.1 for 64-bit
    Copyright (C) Microsoft Corporation 2010. All rights reserved.
    NULL
    Started:  10:36:48 AM
    Error: 2015-03-31 10:36:48.48
       Code: 0xC0016016
       Source:  
       Description: Failed to decrypt protected XML node
    "DTS:Password" with error 0x8009000B "Key not valid for use in
    specified state.". You may not be authorized to access this information.
    This error occurs when there is a cryptographic error. Verify that
     the correct key is available.
    End Error
    Progress: 2015-03-31 10:36:48.65
       Source: Data Flow Task 1
       Validating: 0% complete
    End Progress
    Progress: 2015-03-31 10:36:48.81
       Source: Data Flow Task 1
       Validating: 50% complete
    End Progress
    Progress: 2015-03-31 10:36:48.81
       Source: Data Flow Task 1
       Validating: 100% complete
    End Progress
    Progress: 2015-03-31 10:36:48.82
       Source: Data Flow Task 1
       Validating: 0% complete
    End Progress
    Progress: 2015-03-31 10:36:48.88
       Source: Data Flow Task 1
       Validating: 50% complete
    End Progress
    Progress: 2015-03-31 10:36:48.89
       Source: Data Flow Task 1
       Validating: 100% complete
    End Progress
    Progress: 2015-03-31 10:36:48.89
       Source: Data Flow Task 1
       Prepare for Execute: 0% complete
    End Progress
    Progress: 2015-03-31 10:36:48.89
       Source: Data Flow Task 1
       Prepare for Execute: 50% complete
    End Progress
    Progress: 2015-03-31 10:36:48.89
       Source: Data Flow Task 1
       Prepare for Execute: 100% complete
    End Progress
    Progress: 2015-03-31 10:36:48.95
       Source: Data Flow Task 1
       Pre-Execute: 0% complete
    End Progress
    Progress: 2015-03-31 10:36:49.03
       Source: Data Flow Task 1
       Pre-Execute: 50% complete
    End Progress
    Warning: 2015-03-31 10:36:49.03
       Code: 0x80070003
       Source: Data Flow Task 1 Destination - tb_month_standard_idx_table_exp_032013-082013_20140307_csv
    [34]
       Description: The system cannot find the path specified.
    End Warning
    Progress: 2015-03-31 10:36:49.28
       Source: Error Msg
       Executing query "insert into
    focusbase.dbo.tb_ctrl_package_error_ms...".: 100% complete
    End Progress
    Error: 2015-03-31 10:36:49.28
       Code: 0xC020200E
       Source: Data Flow Task 1 Destination -
    tb_month_standard_idx_table_exp_032013-082013_20140307_csv [34]
       Description: Cannot open the datafile
    "D:\Procogs_export_validation\StandardSetup\tb_month_standard_idx_table_exp_032013-082013_20140307.csv".
    End Error
    Progress: 2015-03-31 10:36:49.29
       Source: Error Msg
       Executing query "insert into
    focusbase.dbo.tb_ctrl_package_error_ms...".: 100% complete
    End Progress
    Error: 2015-03-31 10:36:49.29
       Code: 0xC004701A
       Source: Data Flow Task 1 SSIS.Pipeline
       Description: component "Destination -
    tb_month_standard_idx_table_exp_032013-082013_20140307_csv" (34) failed
    the pre-execute phase and returned error code 0xC020200E.
    End Error
    Progress: 2015-03-31 10:36:49.29
       Source: Data Flow Task 1
       Pre-Execute: 100% complete
    End Progress
    Progress: 2015-03-31 10:36:49.29
       Source: Data Flow Task 1
       Post Execute: 0% complete
    End Progress
    Progress: 2015-03-31 10:36:49.29
       Source: Data Flow Task 1
       Post Execute: 50% complete
    End Progress
    Progress: 2015-03-31 10:36:49.29
       Source: Data Flow Task 1
       Cleanup: 0% complete
    End Progress
    Progress: 2015-03-31 10:36:49.29
       Source: Data Flow Task 1
       Cleanup: 50% complete
    End Progress
    Progress: 2015-03-31 10:36:49.29
       Source: Data Flow Task 1
       Cleanup: 100% complete
    End Progress
    DTExec: The package execution returned DTSER_FAILURE (1).
    Started:  10:36:48 AM
    Finished: 10:36:49 AM
    Elapsed:  0.905 seconds
    NULL<o:p></o:p>
    <o:p> </o:p>
    <o:p> </o:p>

    Hi,
    That path is not in use?! Yes, it is in error, but not in package. Maybe it has been there before, but now I can't find it. Or actually, path is valid, but not the file name.
    I had on error in package configuration file path, but here is the latest error message:
    Br,
    Ville
    Microsoft (R) SQL Server Execute Package Utility
    Version 10.50.1600.1 for 64-bit
    Copyright (C) Microsoft Corporation 2010. All rights reserved.
    NULL
    Started:  1:50:59 PM
    Error: 2015-03-31 13:50:59.38
       Code: 0xC0016016
       Source:  
       Description: Failed to decrypt protected XML node
    "DTS:Password" with error 0x8009000B "Key not valid for use in
    specified state.". You may not be authorized to access this information.
    This error occurs when there is a cryptographic error. Verify that
     the correct key is available.
    End Error
    Progress: 2015-03-31 13:50:59.56
       Source: Data Flow Task 1
       Validating: 0% complete
    End Progress
    Progress: 2015-03-31 13:50:59.72
       Source: Data Flow Task 1
       Validating: 50% complete
    End Progress
    Progress: 2015-03-31 13:50:59.72
       Source: Data Flow Task 1
       Validating: 100% complete
    End Progress
    Progress: 2015-03-31 13:50:59.73
       Source: Data Flow Task 1
       Validating: 0% complete
    End Progress
    Progress: 2015-03-31 13:50:59.79
       Source: Data Flow Task 1
       Validating: 50% complete
    End Progress
    Progress: 2015-03-31 13:50:59.79
       Source: Data Flow Task 1
       Validating: 100% complete
    End Progress
    Progress: 2015-03-31 13:50:59.79
       Source: Data Flow Task 1
       Prepare for Execute: 0% complete
    End Progress
    Progress: 2015-03-31 13:50:59.79
       Source: Data Flow Task 1
       Prepare for Execute: 50% complete
    End Progress
    Progress: 2015-03-31 13:50:59.79
       Source: Data Flow Task 1
       Prepare for Execute: 100% complete
    End Progress
    Progress: 2015-03-31 13:50:59.86
       Source: Data Flow Task 1
       Pre-Execute: 0% complete
    End Progress
    Progress: 2015-03-31 13:50:59.92
       Source: Data Flow Task 1
       Pre-Execute: 50% complete
    End Progress
    Warning: 2015-03-31 13:50:59.92
       Code: 0x80070003
       Source: Data Flow Task 1 Destination -
    tb_month_standard_idx_table_exp_032013-082013_20140307_csv [34]
       Description: The system cannot find the path specified.
    End Warning
    Progress: 2015-03-31 13:51:00.17
       Source: Error Msg
       Executing query "insert into
    focusbase.dbo.tb_ctrl_package_error_ms...".: 100% complete
    End Progress
    Error: 2015-03-31 13:51:00.17
       Code: 0xC020200E
       Source: Data Flow Task 1 Destination -
    tb_month_standard_idx_table_exp_032013-082013_20140307_csv [34]
       Description: Cannot open the datafile
    "D:\Procogs_export_validation\StandardSetup\tb_month_standard_idx_table_exp_032013-082013_20140307.csv".
    End Error
    Progress: 2015-03-31 13:51:00.17
       Source: Error Msg
       Executing query "insert into
    focusbase.dbo.tb_ctrl_package_error_ms...".: 100% complete
    End Progress
    Error: 2015-03-31 13:51:00.17
       Code: 0xC004701A
       Source: Data Flow Task 1 SSIS.Pipeline
       Description: component "Destination -
    tb_month_standard_idx_table_exp_032013-082013_20140307_csv" (34) failed
    the pre-execute phase and returned error code 0xC020200E.
    End Error
    Progress: 2015-03-31 13:51:00.17
       Source: Data Flow Task 1
       Pre-Execute: 100% complete
    End Progress
    Progress: 2015-03-31 13:51:00.17
       Source: Data Flow Task 1
       Post Execute: 0% complete
    End Progress
    Progress: 2015-03-31 13:51:00.17
       Source: Data Flow Task 1
       Post Execute: 50% complete
    End Progress
    Progress: 2015-03-31 13:51:00.17
       Source: Data Flow Task 1
       Cleanup: 0% complete
    End Progress
    Progress: 2015-03-31 13:51:00.17
       Source: Data Flow Task 1
       Cleanup: 50% complete
    End Progress
    Progress: 2015-03-31 13:51:00.17
       Source: Data Flow Task 1
       Cleanup: 100% complete
    End Progress
    DTExec: The package execution returned DTSER_FAILURE (1).
    Started:  1:50:59 PM
    Finished: 1:51:00 PM
    Elapsed:  0.858 seconds
    NULL<o:p></o:p>

  • How to execute private procedures in a package

    Hi
    I have created private procedures in a package.
    now i want to execute the private procedure. how to execute the private one

    Hi;
    Pelase see below which could be helpful for your issue:
    Private procedures in a package
    http://stackoverflow.com/questions/924490/how-do-i-execute-private-procedures-in-an-oracle-package
    Regard
    Helios

  • GRANT EXECUTE ON SCHEMA.PACKAGE.PROCEDURE TO USER

    Hi,
    GRANT EXECUTE ON SCHEMA.PACKAGE.PROCEDURE TO USER
    returns:
    ORA-00905, do you know why? Can I grant privileges on procedure inside package?
    thanks

    As per my knowledge of oracle, we cannot grant privileges on procedure inside a package.
    <br><br>
    Raj<br>
    <b>www.oraclebrains.com<a>
    <br><font color="#FF0000">POWERED by the people, to the people and for the people WHERE ORACLE IS PASSION.</font></b>
    <br>
    Sorry Leonardo Horikian & Kamal Kishore, I was late and didn't know that you guys have already posted the answer.
    Message was edited by:
    rajs

  • How to execute the packaged procedure

    Hello i've written the following package: It's created fine but while running that procedure i'm getting the following error
    create or replace package ttt_example as
      TYPE ColumnsInfo IS RECORD (
          columnName VARCHAR2 (30),
          dataType VARCHAR2 (30)
    TYPE ColumnsInfoList IS TABLE OF ColumnsInfo; 
    FUNCTION getColumns (
          schemaName VARCHAR2,
          tableName VARCHAR2
          RETURN ColumnsInfoList;
    PROCEDURE fillTable (
          schemaName VARCHAR2,
          tableName VARCHAR2
    end;
    create or replace package body ttt_example is
    PROCEDURE fillTable (
          schemaName VARCHAR2,
          tableName VARCHAR2
       ) IS
          i NUMBER;
          columnsList ColumnsInfoList;
          columnsStr VARCHAR2 (4000);
          valList VARCHAR2 (4000) := NULL;
          insertTime VARCHAR2 (100);
       BEGIN
          DBMS_OUTPUT.PUT_LINE ('fillTable - BEGIN');
          columnsList := getColumns (schemaName, tableName);
          i := columnsList.FIRST;
          IF i IS NOT NULL THEN
             columnsStr := columnsList (i).columnName;
             i := columnsList.NEXT (i);
          END IF;
          WHILE i IS NOT NULL LOOP
             columnsStr := columnsStr || ', ' || columnsList (i).columnName;
             i := columnsList.NEXT (i);
          END LOOP;
          i := columnsList.FIRST;
          WHILE i IS NOT NULL LOOP
             IF i != columnsList.LAST THEN
                IF columnsList (i).dataType = 'NUMBER' THEN
                   valList := valList || i || ', ';
                ELSIF columnsList (i).dataType = 'VARCHAR2' THEN
                   valList := valList || '''' || i || '''' || ', ';
                ELSIF columnsList (i).dataType = 'DATE' THEN
                   --EXECUTE IMMEDIATE 'SELECT TO_CHAR(SYSTIMESTAMP) FROM dual' INTO insertTime;
                   --valList := valList ||''''|| insertTime||''''|| ', ';
                   valList := valList || 'SYSDATE, ';
                ELSE
                   DBMS_OUTPUT.PUT_LINE ('WRONG DATA TYPE ' || columnsList (i).dataType);
                END IF;
             ELSE
                IF columnsList (i).dataType = 'NUMBER' THEN
                   valList := valList || i;
                ELSIF columnsList (i).dataType = 'VARCHAR2' THEN
                   valList := valList || '''' || i || '''';
                ELSIF columnsList (i).dataType = 'DATE' THEN
                   --EXECUTE IMMEDIATE 'SELECT TO_CHAR(SYSTIMESTAMP) FROM dual' INTO insertTime;
                   --valList := valList ||''''|| insertTime||'''';
                   valList := valList || 'SYSDATE';
                ELSE
                   DBMS_OUTPUT.PUT_LINE ('WRONG DATA TYPE ' || columnsList (i).dataType);
                END IF;
             END IF;
             i := columnsList.NEXT (i);
          END LOOP;
          DBMS_OUTPUT.PUT_LINE ('fillTable - MIDDLE');
          EXECUTE IMMEDIATE 'INSERT INTO ' || tableName || '(' || columnsStr || ') VALUES (' || valList || ')';
          DBMS_OUTPUT.PUT_LINE ('fillTable - END');
       END;
    FUNCTION getColumns (
          schemaName VARCHAR2,
          tableName VARCHAR2
          RETURN ColumnsInfoList IS
          columnsList ColumnsInfoList;
       BEGIN
          DBMS_OUTPUT.PUT_LINE ('getColumns - BEGIN');
          EXECUTE IMMEDIATE 'SELECT COLUMN_NAME, DATA_TYPE FROM ALL_TAB_COLUMNS WHERE OWNER = ''' || schemaName || ''' AND TABLE_NAME = ''' || tableName || ''''
          BULK COLLECT INTO columnsList;
          DBMS_OUTPUT.PUT_LINE ('getColumns - END');
          RETURN columnsList;
       EXCEPTION
          WHEN OTHERS THEN
                      RAISE;
       END;
    end;
    /  While executing that package procedure
    SQL> begin
      2  ttt_example.fillTable('TEST','EMPE');
      3  end;
      4  /
    begin
    ERROR at line 1:
    ORA-00928: missing SELECT keyword
    ORA-06512: at "ttt.TTT_EXAMPLE", line 60
    ORA-06512: at line 2help me in this

    I was able to reproduce with NULL for columnstr;
    create table t (c1 varchar2(20), c2 varchar2(20));
    Table created
    create or replace procedure p
      tablename  varchar2,
      columnsstr varchar2,
      vallist    varchar2
    ) is
    begin
      execute immediate 'INSERT INTO ' || tablename || '(' || columnsstr ||
                        ') VALUES (' || vallist || ')';
    end;
    Procedure created
    exec p('t', 'c1,c2', '''a'',''b''');
    PL/SQL procedure successfully completed
    select * from t;
    C1                   C2
    a                    b
    exec p('t', '', '''a'',''b''');
    begin p('t', '', '''a'',''b'''); end;
    ORA-00928: missing SELECT keyword
    ORA-06512: at "MSCALLION.P", line 8
    ORA-06512: at line 2

  • How to execute the packaged procedure(having out param) in TOAD for Oracle

    Hi.
    Could you help me
    How to execute the packaged procedure having out parameters in TOAD for Oralce..
    Thanks..

    Use anonymous PL/SQL block to execute it.
    Example.
    DECLARE
      <out variable name> <out variable data type>;
    BEGIN
      <package name>.<procedure name>(<out variable name>);
    END;

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

Maybe you are looking for

  • On my macbook pro, how do I eliminate file automatic copying

    On my macbook pro when I move a file or folder from the desktop to the hard drive, it's copied automatically. How can I eliminate that? BTW, when I move a file or folder from the HD to the desktop, it does NOT get copied. Thanks in advance for your h

  • How to change the datatype of a column having lots of data.

    My table :: select hrm_employeeentitlement_id, amount FROM hrm_employeeentitlement; need to change the Amount column :( From :: amount Number(18,0) To :: amount Number(10,2) I am using 10XE thanks in advance w\

  • IPod touch v4 and Apple remote - not all routers are compatible

    My iPod is working well with my old router at home I can connect Apple remote from my iPod to iTunes in my computer and use all the functions I recently bought a new router but I soon found out that the remote application is not working with it Simil

  • Sun Java System Directory Server 5.2

    Hi, We were informed by a third party that we can download Sun Java System Directory Server 5.2 SP 1 from the Sun downloads area. However, we couldn't find 5.2 Service Pack 1. We did find that Directory Server 5 2005Q4 (5.2 patch 4) is the only one a

  • How to zero array within loop that displays 3 numbers when program is started?

    i am starting a loop that displays 3 pieces of data that is updated throught the cycle. At the end it displaces the last result. When the program is run again i need these values to be reset. This is a loop inside of a loop inside of a loop. Attachme