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

Similar Messages

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

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

  • Procedure to execute other procedures in a package

    I have written the following package:
    CREATE
    OR REPLACE PACKAGE NCI_LOAD_PKG AS
    PROCEDURE LOAD_W;
    PROCEDURE LOAD_X;
    PROCEDURE LOAD_Y;
    PROCEDURE LOAD_Z;
    END NCI_LOAD_PKG;
    I want to know what is the best way to call these procedures. Do I need to wirte a Unix script for this or just a pls procedure in the package itself. Also keeping in consideration that this package needs to run every night. I am not sure what I need to do. If anyone can give me some direction it will be very helpful.
    Thanks.
    Message was edited by:
    rap1108
    Message was edited by:
    rap1108

    You can call a packaged procedure from PL/SQL just by prefixing the package name, i.e.
    BEGIN
      <<package name>>.<<procedure name>>( <<argument list>> );
    END;If you create a procedure in the package, though, you can call other procedures in the same package without qualifying the procedure name with the package name.
    Justin

  • How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?

    Hi 
    I have a stored procedure. It can be executed like this
    exec test @p = 1;
    exec test @p = 2
    exec test @p = n;
    n can be hundred.
    I want the sp being executed in parallel, not sequence. It means the 3 examples above can be run at the same time.
    If I know the number in advance, say 3, I can create 3 different Execution SQL Tasks. They can be run in parallel.
    However, the n is not static. It is coming from a table. 
    How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?
    I think about using script task. In the script, I get the value of n, and the list of p, from the table, then running a loop with. In the loop, I create a threat and in the threat, I execute the sp like : exec test @p = p. So the exec test may
    be run parallel. But I am not sure if it works.
    Any idea is really appreciated.

    Hi nam_man,
    According to your description, you want to call stored procedures in parallel, right?
    In SSIS, we can create separate jobs with different stored procedures, then set the same schedule to kick the jobs off at the same time. In this way, we should be careful to monitor blocking and deadlocking depending on what the jobs are doing.
    We can also put all stored procedures in SSIS Sequence container, then they will be run in parallel.
    For more information about SSIS job and Sequence container, please refer to the following documents:
    http://www.mssqltips.com/sqlservertutorial/220/scheduling-ssis-packages-with-sql-server-agent/
    https://msdn.microsoft.com/en-us/library/ms139855(v=sql.110).aspx
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • How to execute a procedure depending on the result of a query?

    Hello, I'm new in ODI.
    I want to execute a procedure depending on the result of a query Oracle table.
    We have a Oracle Table whit a column that contains two possibles values.
    I want read the table, row by row, and depending on this value, execute a Procedure or execute another.
    How can i do?

    what you need to do is
    1. create a variable which "new_var2" which has the count of the number of rows you want to process. must be data type numeric.
    2. copy "new_var2" to the package screen.
    3. duplicate the "new_var2" on the package screen and evaluate the variable and test for "> 0" zero, call it "new_var2_E"
    3. create a new odi variable "new_var1" with a refresh of "select field1 fom (select field1,rownum as rownumber from tablex) where rownumber = #new_var2" in the relevant schema and technology.
    4. copy "new_var1" into your package (some where in the flow)
    5. right click the "new_var1" variable in you package screen and you should get the option duplicate step (click on that)
    6. select the the duplicate "new_var1" on the package screen and correct the the name to something meaning full to you "new_var1_E", also change the "type" to "evaluate variable" then you should see a "value" box. enter one of the values you want to test in the box (remember do not put in quotes ' )
    7. now back on the package screen join the "new_var1" to the "new_var1_E" with an OK line
    8 you now join "new_var2" to "new_var2_E" with OK
    9 you join "new_var2_E" to "new_var1"
    10. you then join the "new_var1_E" with an OK or a KO line to the relevant procedure.
    12. you need to duplicate "new_var2" in the package screen one more time this time and call it "new_var2_D" set the type to evaluate and then select the increment of -1
    13. the relevant procedure to "new_var2_D" with an OK
    14. join the "new_var2_D" to the "new_var2_E" with an OK
    15. this should close off the loop now the exit point is "new_var2_E" with a KO line to the next part of your process....
    Basically you should end up with a loop on new_var2 decementing, and it is used to get a specific next record row from your table.
    Hope this helps, sorry it is a little long winded..
    Edited by: DavidGD on Feb 8, 2009 3:29 PM

Maybe you are looking for