Calling oracle procedure from batch script

i have a .bat file, in which i am using sqlldr to load into a staging table from csv file, and then using merge to insert / update into target table
i have 2 doubts
1) my first doubt is regarding batch script..how to handle the errorlevels which are greater than 1?
so generally speaking, how do i handle all the errors at once..and make sure the control goes to
run_sqlldr0 always? and handle the error meaningfully if its other than 0 ?
below is my batch script, and i get error
goto run_sqlldr2
the system cannot find the batch label specified - run_sqlldr2
@echo on
call oraenv.bat
if not exist %mainpath% goto mainpath_def
if not exist %scripts% goto scriptspath_def
if not exist %logs% goto logspath_def
if not exist %data% goto datapath_def
goto x1
:x1
goto run_sqlldr%ERRORLEVEL%
echo run_sqlldr%ERRORLEVEL%
if run_sqlldr%ERRORLEVEL% NEQ 0 goto run_sqlldr1
echo "entering sqlldr"
:run_sqlldr1
echo "entered sqlldr1"
echo "some error"
echo mergedata%ERRORLEVEL%
:run_sqlldr0
echo "entered sqlldr0"
sqlldr userid = scott/tiger@orcl control=%mainpath%\cm.ctl log=%logs%\cm.log discard=%logs%\cm.dsc bad=%logs%\cm.bad SILENT=(HEADER, FEEDBACK)
goto mergedata%ERRORLEVEL%
:mergedata1
echo "entered mergedata1"
echo cleandata%ERRORLEVEL%
:mergedata0
sqlplus -s scott/tiger@orcl @%scripts%\merge_stg.sql
goto cleandata%ERRORLEVEL%
:cleandata1
echo "entered cleandata1"
sqlplus -s scott/tiger@orcl @%scripts%\clean_stg.sql
goto exit
:cleandata0
echo "entered cleandata0"
echo "error in removing data"
goto exit
:mainpath_def
echo "mainpath not existing as specified %mainpath%, Please edit ORAENV with correct value"
goto exit
:scriptspath_def
echo "scripts path not existing as specified %scripts%, Please edit ORAENV with correct value"
goto exit
:logspath_def
echo "Logs path not existing as specified %logs%, Please edit ORAENV with correct value"
goto exit
:datapath_def
echo "Data path not existing as specified %data%, Please edit ORAENV with correct value"
goto exit
:exit
2) my second doubt, is this the right way of calling the stored procedures merge_stg and clean_stg?
in clean_stg, i use dynamic sql to truncate the staging table
create or replace procedure trunstg is
lsql varchar2(2000) := 'truncate table stg_ldrtest';
begin
execute immediate lsql;
end;
/

i have changed the code
@echo on
call oraenv.bat
if not exist %mainpath% goto mainpath_def
if not exist %scripts% goto scriptspath_def
if not exist %logs% goto logspath_def
if not exist %data% goto datapath_def
goto x1
:x1
goto run_sqlldr%ERRORLEVEL%
echo run_sqlldr errorlevel: %ERRORLEVEL%
if run_sqlldr%ERRORLEVEL% NEQ 0 goto run_sqlldr1
echo "entering sqlldr"
:run_sqlldr1
echo "entered sqlldr1"
echo "some error"
:run_sqlldr2
echo errorlevel: %errorlevel%
echo mergedata%ERRORLEVEL%
:run_sqlldr0
echo "entered sqlldr0"
sqlldr userid = gautam/gautam@orcl control=%mainpath%\cm.ctl log=%logs%\cm.log discard=%logs%\cm.dsc bad=%logs%\cm.bad SILENT=(HEADER, FEEDBACK)
goto mergedata%ERRORLEVEL%
:mergedata1
echo "entered mergedata1"
goto end
echo cleandata%ERRORLEVEL%
:mergedata0
sqlplus -s gautam/gautam@orcl @%scripts%\merge_stg.sql
goto cleandata%ERRORLEVEL%
:cleandata1
echo "entered cleandata1"
echo "cleaning error"
goto end
:cleandata0
sqlplus -s gautam/gautam@orcl @%scripts%\clean_stg.sql
goto end
:mainpath_def
echo "mainpath not existing as specified %mainpath%, Please edit ORAENV with correct value"
goto exit
:scriptspath_def
echo "scripts path not existing as specified %scripts%, Please edit ORAENV with correct value"
goto exit
:logspath_def
echo "Logs path not existing as specified %logs%, Please edit ORAENV with correct value"
goto exit
:datapath_def
echo "Data path not existing as specified %data%, Please edit ORAENV with correct value"
goto exit
:end
EXIT
so the error is ORA - 30926, unable to get a stable set of
rows in the source tables
my merge is
MERGE INTO ldrtest D
USING (SELECT code,id,row_name,col1,col2,col3,crt_tm,md_tm,crt_user,mod_usr FROM stg_ldrtest) S
ON (d.code = s.code and d.id = s.id and d.row_name=s.row_name )
WHEN MATCHED THEN UPDATE SET d.col1 = s.col1,
d.col2 = s.col2,
d.col3 = s.col3,
d.crt_tm = s.crt_tm,
d.md_tm = s.md_tm,
d.crt_user = s.crt_user,
d.mod_usr = s.mod_usr
WHEN NOT MATCHED THEN INSERT (d.code,d.id,d.row_name,d.col1,d.col2,d.col3,d.crt_tm,d.md_tm,d.crt_user,d.mod_usr)
VALUES (s.code,s.id,S.row_name, s.col1,s.col2,s.col3,s.crt_tm,s.md_tm,s.crt_user,s.mod_usr);
i did not understand what this error means..
could anyone please help me out

Similar Messages

  • Call oracle procedure from NT scheduler

    How can we call a procedure from NT schedular / Unix schedular ?
    Atul

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by ATUL SRIVASTAV ([email protected]):
    How can we call a procedure from NT schedular / Unix schedular ?
    Atul<HR></BLOCKQUOTE>
    Hi
    You can write SQL*Plus script and put sqlplus in NT scheduler or Unix cron table. The onle problem is that password must present in command line, so you should think how to keep it. Starting of sqlplus can be in .bat file or shell script unvisible for nonauthorized persons.
    Regards
    null

  • How to call a procedure from  Shell Script

    Friends,
    How can i call a procedure from a shell script ? If any one know the answer , let me know immediately .
    Thanks in advance .
    Chakks

    We connect using SQLPlus commands on the Unix server:-
    Our code block is below:- We've got DBMS_OUTPUT in the procedure, hence the spooling. You don't need all this, but you do need the sqlplus directory, etc... in your profile.
    sqlplus -s <<EOF > ${CREATE_LOG_FLE}
    $UserName/$Password@$SID
    SET SERVEROUTPUT ON SIZE 1000000;
    spool ${CREATE_LOG_FLE}
    EXECUTE $STORED_PROC(${Months}, ${DeleteRecords});
    EOF
    Hope that helps

  • Calling stored procedure from php script.

    I have the following stored procedure in Oracle 8:
    CREATE OR REPLACE procedure kunde_create
    (iname1 in varchar2,
    iname2 in varchar2,
    iname3 in varchar2,
    ianrede in number,
    istrasse in varchar2,
    iland varchar2,
    iplz in varchar2,
    iort in varchar2,
    iortsteil in varchar2,
    itelefon in varchar2,
    iemail in varchar2,
    itelefax in varchar2,
    imobil in varchar2,
    ianrufer in varchar2,
    izusinfo in varchar2,
    izusatz2 in varchar2,
    okdnr out varchar2)
    is
    vkndnr number;
    vadrnr number;
    vkdnr varchar2(15);
    ikugru constant number:=4;
    minkdnr constant varchar2(15):='44000000';
    maxkdnr constant varchar2(15):='50000000';
    begin
    ..... SOME CODE ....
    okdnr:='something_to_output';
    commit;
    end kunde_create;
    I am trying to call this SP from a php script, in this way:
    $connection = ora_logon("username@db", "password");
    $cursor = ora_open($connection);
    ora_commitoff($connection);
    $cu=ora_parse($cursor, "begin KW.kunde_create ( :Sta_nameD, :Sta_name2D, :Sta_kugruD, :ianredeD, :Sta_straD, :Sta_landD, :Sta_plzD, :Sta_ortD, :Sta_ortsteilD, :Sta_telD, :Sta_mailD, :Sta_faxD, :Sta_tel2D, :Sta_anruD, :Sta_zusD, :Sta_zus2D ,:okdnr); end;");
    ora_bind($cursor, ":Sta_nameD", $Sta_nameD, 32, 1);
    ora_bind($cursor, ":Sta_name2D", $Sta_name2D, 32, 1);
    ora_bind($cursor, ":ianredeD", $ianredeD, 32, 1);
    ora_bind($cursor, ":Sta_straD", $Sta_straD, 32, 1);
    ora_bind($cursor, ":Sta_landD", $Sta_landD, 32, 1);
    ora_bind($cursor, ":Sta_plzD", $Sta_plzD, 32, 1);
    ora_bind($cursor, ":Sta_ortD", $Sta_ortD, 32, 1);
    ora_bind($cursor, ":Sta_ortsteilD", $Sta_ortsteilD, 32, 1);
    ora_bind($cursor, ":Sta_telD", $Sta_telD, 32, 1);
    ora_bind($cursor, ":Sta_mailD", $Sta_mailD, 32, 1);
    ora_bind($cursor, ":Sta_faxD", $Sta_faxD, 32, 1);
    ora_bind($cursor, ":Sta_tel2D", $Sta_tel2D, 32, 1);
    ora_bind($cursor, ":Sta_anruD", $Sta_anruD, 32, 1);
    ora_bind($cursor, ":Sta_zusD", $Sta_zusD, 32, 1);
    ora_bind($cursor, ":Sta_zus2D", $Sta_zus2D, 32, 1);
    ora_bind($cursor, ":okdnr", $okdnr, 32, 2);
    ora_exec($cursor); //Line 93
    This code brings me back this error:
    Warning: Can't find variable for parameter in /www/vaillant/htdocs/www_tisweb/html/php/testdb/connect.php on line 93
    I tried nearlly everything, but it doesnt work :(
    Can anybody help me please.
    Thanx in advance,
    Ahmed Adaileh

    I had to make a few modifications to get your example to work. The
    biggest change was to the ora_bind syntax. I also found I had to
    define a variable to hold the OUT value before doing the ora_exec.
    Otherwise I got the error you saw. I'm not sure why defining it first
    is necessary. I didn't dig deeply into PHP's oracle.c code.
    My final script is below. It displays "okdnr is something_to_output".
    I tested using PHP 4.3.3 against Oracle 9.2.
    The best general suggestion I can make is to use PHP's oci8 driver
    unless you need to be compatible with existing PHP code. There is an
    example of using OUT binds in oci8 to call a stored procedure at
    PHP and serveroutput
    -- CJ
    <?php
    // Changed connection details to suit my environment
    $connection = ora_logon("scott@MYDB", "tiger");
    $cursor = ora_open($connection);
    ora_commitoff($connection);
    // Changed schema to SCOTT to match who I'd created the procedure as
    $cu=ora_parse($cursor, "begin SCOTT.kunde_create ( :Sta_nameD, :Sta_name2D, :Sta_kugruD, :ianredeD, :Sta_straD, :Sta_landD, :Sta_plzD, :Sta_ortD, :Sta_ortsteilD, :Sta_telD, :Sta_mailD, :Sta_faxD, :Sta_tel2D, :Sta_anruD, :Sta_zusD, :Sta_zus2D ,:okdnr); end;");
    // Allocated the IN parameter variables
    $Sta_nameD      = 'a';
    $Sta_name2D     = 'a';
    $ianredeD       = 1;
    $Sta_straD      = 'a';
    $Sta_landD      = 'a';
    $Sta_plzD       = 'a';
    $Sta_ortD       = 'a';
    $Sta_ortsteilD  = 'a';
    $Sta_telD       = 'a';
    $Sta_mailD      = 'a';
    $Sta_faxD       = 'a';
    $Sta_tel2D      = 'a';
    $Sta_anruD      = 'a';
    $Sta_zusD       = 'a';
    $Sta_zus2D      = 'a';
    $Sta_kugruD     = 'a';
    // Changed ora_bind syntax to match
    // http://www.php.net/manual/en/function.ora-bind.php
    ora_bind($cursor, "Sta_nameD", ":Sta_nameD", 32, 1);
    ora_bind($cursor, "Sta_name2D", ":Sta_name2D", 32, 1);
    // Change ianredeD type to 2 to match procedure definition
    ora_bind($cursor, "ianredeD", ":ianredeD", 32, 2);
    ora_bind($cursor, "Sta_straD", ":Sta_straD", 32, 1);
    ora_bind($cursor, "Sta_landD", ":Sta_landD", 32, 1);
    ora_bind($cursor, "Sta_plzD", ":Sta_plzD", 32, 1);
    ora_bind($cursor, "Sta_ortD", ":Sta_ortD", 32, 1);
    ora_bind($cursor, "Sta_ortsteilD", ":Sta_ortsteilD", 32, 1);
    ora_bind($cursor, "Sta_telD", ":Sta_telD", 32, 1);
    ora_bind($cursor, "Sta_mailD", ":Sta_mailD", 32, 1);
    ora_bind($cursor, "Sta_faxD", ":Sta_faxD", 32, 1);
    ora_bind($cursor, "Sta_tel2D", ":Sta_tel2D", 32, 1);
    ora_bind($cursor, "Sta_anruD", ":Sta_anruD", 32, 1);
    ora_bind($cursor, "Sta_zusD", ":Sta_zusD", 32, 1);
    ora_bind($cursor, "Sta_zus2D", ":Sta_zus2D", 32, 1);
    // Changed okdnr type to 1 to match procedure definition
    ora_bind($cursor, "okdnr", ":okdnr", 32, 1);
    // Bound missing parameter
    ora_bind($cursor, "Sta_kugruD", ":Sta_kugruD", 32, 1);
    // Preallocated the output variable - I'm not sure why this is
    // necessary nor what size is needed.
    // When this line is commented out I get:
    //   Warning: Can't find variable for parameter in test01.php on line XX
    $okdnr = "a";
    ora_exec($cursor);
    print "okdnr is $okdnr";
    ?>

  • Problem in calling oracle procedure from java

    Oracle procedure with the following parameters.
    CREATE OR REPLACE PROCEDURE CREDITED_TO_STORE_INSERT (P_CUST# IN NUMBER,
    P_INV_DATE IN DATE,
    P_MEMO# IN NUMBER,
    P_SESS_ID IN VARCHAR2 ) IS
    BEGIN
    /*.........Procedure Body with select and insert statements there no OUT or return variable/value......*/
    END;
    Now i am calling this procedure with the java code in java.
    public boolean execProcedure(String storeNo, String invoiceDate, String claimNo, String sessionID) throws SQLException {
         CallableStatement cstmt = null;
         java.sql.Date invicDate = this.StringToDate(invoiceDate);
         try
         cstmt = conn.prepareCall("{call WEBUSER.CREDITED_TO_STORE_INSERT(?,?,?,?,?,?)}");
         cstmt.setInt(1, Integer.parseInt(storeNo));
         cstmt.setDate(2, invicDate);
         cstmt.setInt(3, Integer.parseInt(claimNo));
         cstmt.setString(4, sessionID);
         cstmt.execute();
         catch (Exception e)
         System.out.println (e);
         } // catch (Exception e)
         finally
         try
         cstmt.close();
         catch (Exception ex)
         } // catch (Exception ex)
         } // finally
         return true;
    But it will return the following exception.
    [STDOUT] java.sql.SQLException: Missing IN or OUT parameter at index:: 5
    i don't know why :( please help me ...

    your procedure has 4 parameters but in the prepared statement you define 6 placeholders

  • Calling stored procedure from Perl Script

    Need help with the syntax to call a stored procedure with an input paramter using Perl. The input paramter will be set within the perl script.

    there is an oracle module you can find on cpan
    http://cpan.org/modules/by-category/07_Database_Interfaces/Oracle
    of course, you could also use sqlplus binary, as you would do in shell
    hth

  • Calling oracle procedure from ABAP program

    There is a requirement to call the oracle stored procedure with some input parameter from ABAP program.
    Suppose we have order number which is entered by the user in ABAP program.
    This order number needs to be passed to oracle stored procedure as an input parameter in the same ABAP program.
    We can call the oracle stored procedure without parameter using the following syntax
    exec sql
    execute procedure <procedure name>
    end exec.
    But do not know how to execute the oracle stored procedure with some input parameter?

    Apologies , following is the correct code.
    This will definetly solve your problem.
    DATA scarr_carrid TYPE scarr-carrid.
    SELECT-OPTIONS s_carrid FOR scarr_carrid NO INTERVALS.
    DATA s_carrid_wa LIKE LINE OF s_carrid.
    DATA name TYPE c LENGTH 20.
    TRY.
        EXEC SQL.
          CREATE FUNCTION selfunc( input CHAR(3) )
            RETURNING char(20);
            DEFINE output char(20);
            SELECT carrname
                   INTO output
                   FROM scarr
                   WHERE mandt  = '000' AND
                         carrid = input;
            RETURN output;
            END FUNCTION;
        ENDEXEC.
        LOOP AT s_carrid INTO s_carrid_wa
                         WHERE sign = 'I' AND option = 'EQ'.
          TRY.
             EXEC SQL.
                EXECUTE PROCEDURE selfunc( IN  :s_carrid_wa-low,
                                           OUT :name )
              ENDEXEC.
              WRITE: / s_carrid_wa-low, name.
            CATCH cx_sy_native_sql_error.
              MESSAGE `Error in procedure execution` TYPE 'I'.
          ENDTRY.
        ENDLOOP.
        EXEC SQL.
          DROP FUNCTION selfunc;
        ENDEXEC.
      CATCH cx_sy_native_sql_error.
        MESSAGE `Error in procedure handling` TYPE 'I'.
    ENDTRY.
    Reward points if usefull.
    Thanks and regards,
    Veerendranath.

  • How to call oracle procedure from vb

    i created a procedure in oracle8.1.7 to return on value,look the following script:
    Procedure P_COUNT (r out number)
    IS
    BEGIN
    select count(*) into r from demo;
    END;
    but i can get the value from VB,i display some errors:
    ORA-06502 PL/SQL: numeric or value errorstring
    ORA-06512 at stringline string
    what can i do now?
    null

    Hei Zhang,
    Thank You. You can return Cursor in many ways. You can write either a function to return cursor (return type is %ROWTYPE) or a package. Writing a Package seems laborious but I like it as it has lot of flexibility.
    I will give you the example for the second type:
    -- 1) Create a Package first:
    CREATE OR REPLACE PACKAGE pk_MyPackage AS Type RT1 IS RECORD (
    sp_ename emp.ename%TYPE,
    sp_job emp.job%TYPE,
    sp_mgr emp.mgr%TYPE
    TYPE RCT1 IS REF CURSOR RETURN RT1;
    END;
    sho err
    -- 2) Create a Procedure:
    CREATE OR REPLACE PROCEDURE sp_MyProcedure (
    in_empno emp.empno%TYPE,
    RC1 IN OUT pk_MyPackage.RCT1
    ) AS
    BEGIN
    OPEN RC1 FOR
    SELECT ename,
    job,
    mgr
    FROM emp
    WHERE empno = in_empno;
    RETURN;
    END;
    sho err
    --Testing
    SQL> var cr refcursor
    SQL> exec sp_MyProcedure (7934, :cr)
    PL/SQL procedure successfully completed.
    SQL> print cr
    ENAME JOB MGR
    MILLER CLERK 7782
    Hope this is clear and helps you to complete your task.
    Cheers!
    r@m@

  • Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)

    Hi All,
    We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
    Database is Oracle.
    *Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
    Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
    If both are equal, then
         if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
         else  if the field: 'qq' in YY table equals to "Modify"  then take the data from the view table: 'Modify_View'.
    Finally, We need to archive the selected data from the respective view table.*
    From each table, data will come differently, means with different field names.
    I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
    But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
    Is there any way other than Stored Procedure?
    How to handle Data Types as data is coming from two different tables?
    Can we create one data type for two tables?
    Is BPM required for this to collect data from two different tables?
    Can somebody guide me on how to handle this?
    Waiting eagerly for help which will be rewarded.
    Thanks and Regards,
    Jyothirmayi.

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • Error when calling a procedure from my apex application

    Hello.
    I want to create a small APEX application that can configure asynchronous change data capture (distributed hotlog) on certain tables.
    Basically, what the application should do is to simply create change tables. Everything else is set up as prerequisite.
    My problem is that when I run the following script from schema apex_cdd (using sqldeveloper) , it works; but if I run it from my apex application by calling it when pressing a button as a pl/sql process, it doen't work.
    BEGIN
    apex_cdc.enable_table_capture
         (     i_owner => 'staging_cdcpub',
              i_change_table_name     => 'g_changeTable',
              i_change_set_name     => 'Source_changeSet',
              i_change_source          => 'orcl01_cs',
              i_source_schema          => 'My_src',
              i_source_table          => 'G',
              i_column_type_list     => 'STARTDATE DATE,STATUS CHAR(1),NAME VARCHAR2(10),ENDDATE DATE,DESCRIPTION VARCHAR2(255),ID NUMBER(8,0),VALUE NUMBER(10,2)'
    END;
    If I look in the trace file, i see that the error is:
    CDCdebug:in ChangeTable.java enableDisabledTriggers: ORA-06550: line 1, column 8:
    PLS-00201: identifier 'SYS.DBMS_CDC_SYS_IPUBLISH' must be declared
    ORA-06550: line 1, column 8:
    PL/SQL: Statement ignored
    oracle.jdbc.driver.OracleSQLException: ORA-06550: line 1, column 8:
    PLS-00201: identifier 'SYS.DBMS_CDC_SYS_IPUBLISH' must be declared
    ORA-06550: line 1, column 8:
    PL/SQL: Statement ignored
    Other remarks:
    - My procedure calls: sys.DBMS_CDC_PUBLISH.CREATE_CHANGE_TABLE.
    - I gave the same rights that I gave for apex_cdc schema to flows_030200 and APEX_PUBLIC_USER schemas (just to see if it works), but it doens't.
    Is APEX calling the procedure from another schema ?
    Does anyone has an idea why this procedure crashes if called from APEX application, but works ok if called from the same schema APEX application runs on, but using SQLDeveloper ?
    Any thoughts are appreciated.
    Radian

    The procedure apex_cdc.enable_table_capture i created myself with no authid mentioned explicitly, so it uses definer rights, by default.
    BUt this procedure is simply a wrapper for sys.dbms_cdc_publish.create_change_table.
    When I look on the security model for this sys.dbms_cdc_publish, i see it runs under invoker rights. (http://www.psoug.org/reference/dbms_cdc_publish.html).
    The code is like this:
    CREATE OR REPLACE PROCEDURE enable_table_capture
              i_owner               IN VARCHAR2,
              i_change_table_name     IN VARCHAR2,
              i_change_set_name     IN VARCHAR2,
              i_change_source          IN VARCHAR2,
              i_source_schema          IN VARCHAR2,
              i_source_table          IN VARCHAR2,
              i_column_type_list     IN VARCHAR2
         IS
         BEGIN
              EXECUTE IMMEDIATE 'alter session set REMOTE_DEPENDENCIES_MODE=SIGNATURE';
              EXECUTE IMMEDIATE 'begin add_log@orcl01(i_tableName => ''G''); end;';
    sys.DBMS_CDC_PUBLISH.CREATE_CHANGE_TABLE(
    owner => i_owner,
    change_table_name => i_change_table_name,
    change_set_name => i_change_set_name,
    source_schema => i_source_schema,
    source_table => i_source_table,
    column_type_list => i_column_type_list,
    capture_values => 'both',
    rs_id => 'y',
    row_id => 'n',
    user_id => 'n',
    timestamp => 'y',
    object_id => 'n',
    source_colmap => 'n',
    target_colmap => 'y',
    options_string => NULL);
    END enable_table_capture;

  • Can't call a procedure from a PLSQL Library inside forms 10g

    Hello,
    I build a plsql library using forms builder, then I compile it and add to FORMS_PATH.
    I try to use a procedure from that lib so i attached the library to form (without path), then in then WHEN-BUTTON-PRESSED event I call one procedure from that library and i get this message :
    error 201 at line 6 , column 2
    identifier 'LIST_ADD_ALL' must be declared
    ---- MY CODE compiled ok with out errors i've got pll and plx
    declare
         START_LIST_ID ITEM := FIND_ITEM('LIST16');
         END_LIST_ID ITEM := FIND_ITEM('ITEM18');
    begin
         LIST_ADD_ALL(START_LIST_ID, END_LIST_ID);
    end ;
    I dont know if to put some kind of public declaration.
    can anyone help me please.

    In that case, use a batch file to start Form Builder to control your environment settings. The batch file ( e.g. FormsBuilder.bat ) should look roughly like this:
    set oracle_home=C:\Oracle\Dev10g
    set forms=%oracle_home%\forms
    set nls_lang=AMERICAN_AMERICA.WE8MSWIN1252
    set tns_admin=c:\oracle\admin
    set ca_uprefs=c:\data\oracle\10g\uprefs
    set path=%oracle_home%\bin;%path%
    set forms_path=c:\data
    set oratemp=c:\temp
    start frmbld.exe

  • Calling a procedure from Calculation View with Debug function

    Is it possible to call a debuggable hana procedure in a calculation view?
    I just saw the video  HANA Academy - HANA Native Development Workshop: SQL Script Editor - YouTube for HANA Native Development workshop and got the debug functionality to work for a file Procedure.
    But I am unable to call this procedure from a Calculation View.
    Below is the code I am using for the SQLScript Calculation View. Can someone tell me if this is correct?
    /********* Begin Procedure Script ************/
    BEGIN
    call "_SYS_BIC"."test-package.RF.SalesOrders.procedures/get_sls_ordtype"(SalesDocNo => '0070004105', SalesDocTypes => ?) ;
    var_out = CE_PROJECTION(:SalesDocTypes, ["SALESDOCNO" , "SALESDOCTYPE", "ORDVALUE"] );
    END /********* End Procedure Script ************/

    Hello,
    Just provide the out parameter in the call:
    Declare
      amount   number; -- OUT number argument populated by the procedure
    Begin
      -- call the X procedure --
      x( amount ) ;
    End;Francois

  • Calling a procedure from Dynamic Page

    I am trying to call a procedure from a dynamic page. The procedure displays multi records from a table. I have created a procedure:
    PROCEDURE process_student_request( p_primary_request in wwv_utl_api_types.vc_arr,
    p_alternate_request in wwv_utl_api_types.vc_arr,
    p_action in varchar2,
    l_status in out varchar2);
    When I hit the submit button on the dynamic page it does not execute the procedure and tries to open a new page. How do I get this to work?
    Here is the text of the page:
    <HTML>
    <HEAD>
    <TITLE>Example</TITLE>
    </HEAD>
    <BODY>
    <FORM action="portal30.star_portal.process_student_requests" method="post">
    <TABLE BORDER="0" WIDTH="100%" CELLPADDING="2" CELLSPACING="0" class="RegionBorder">
    <TR>
    <TD valign="top" align="left" width="40%"><FONT class="PortletText1">
    <ORACLE>declare
    row_num number := 1;
    hold_row_num number;
    hold_class_cd stars3.req.class_cd%TYPE;
    begin
    for c1 in (select A.start_yy, A.school, A.student_id, A.class_cd, B.name from stars3.course B, stars3.req A
    where A.student_id = portal30.star_portal.get_session_variable('STUDENT_ID') and A.start_yy = '01' and
    A.alternate_no = '0' and
    B.start_yy = A.start_yy and
    B.school = A.school and
    B.class_cd = A.class_cd)
    loop
    hold_class_cd := c1.class_cd;
    htp.p(lpad(to_char(row_num),2,'0'));
    htp.p('<select name="p_primary_request">');
    htp.p('<option value="' || c1.class_cd|| '">' || c1.name || '</option>');
    row_num := row_num + 1;
    htp.p('<BR>');
    end loop;
    htp.p('<input type="submit" name="p_action">');
    end;
    </ORACLE>
    </BODY>
    </FORM>
    </TD>
    </TR>
    </TABLE>
    </HTML>

    Bob,
    You have variables in your procedure like l_status, p_alternate_status which you do not have in the form. Are these IN or OUT variables ?
    If these are IN variables, this proc will not work because you do not have any variable in the form. So from where does it get the values? There is not any default declared too. You have to explicitly define IN or OUT variables.
    Have you also given execute permission to public ?

  • Calling a procedure from AM

    Hi,
    I am getting the following error while trying to call a procedure from AM. I have check and all the parameters are being passed correctly. Not sure why this is throwing error. Below is the error message.
    oracle.apps.fnd.framework.OAException: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'AbcPositionDetails'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Any help is appreciated.
    Thanks in advance
    PK

    You will get this error when you pass wrong number of arguments to a pl/sql procedure.
    use named parameter binding like proc(a=>'value') to avoid this error.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                       

  • Calling a Procedure from a Button? (REVISITED)

    Hi All,
    I once asked a question Re: Calling a Procedure from a Button? & that problem was resolved when i was working on the online ApEx.
    On my application, requirements have changed a bit: I have one form based on two tables. One table contributes two fields (name & surname) to the form while the remaining fields are contributed by another table to make a total of 17 fields on the form.
    My process is in such a way that a user enters an id number & clicks Search button, if the apllicant exists then both name & surname corresponding with the id number will be retrieved from the database. If the applicant does not exist then an error message will be displayed inline with the id number field. Here's the PL/SQL anonymous block to that:
    DECLARE
    vNAME APPLICANTS.name%TYPE;
    vSURNAME APPLICANTS.surname%TYPE;
    BEGIN
    SELECT count(*)
    INTO :P2_COUNT
    FROM applicants
    WHERE id_number = :P2_ID_NUMBER;
    IF :P2_COUNT > 0 THEN
    SELECT name,surname
    INTO vNAME, vSURNAME
    FROM applicants
    WHERE id_number = :P2_ID_NUMBER;
    :P2_NAME := vNAME;
    :P2_SURNAME := vSURNAME;
    ELSE
    apex_application.g_print_success_message := '<span style="color:red">Applicant does not exist.</span>';
    END IF;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    apex_application.g_print_success_message := '<span style="color:red">Exception Caught.</span>';
    END;The PL/SQL block works except for error displaying part (but that's a problem for another day).
    NB: On my application, there’s already Automated Row Fetch & Automatic Row Processing (DML) processes for one table. Furthermore, there is also a javascript for verifying the validity of an id number. As a result, I decided to include Automated Row Fetch & Automatic Row Processing (DML) processes for the other table. When I click a Search button the javascript is activated even though I did not specify a URL target for the button - because this is a simple button among region items – it does not have Optional Url Redirect section.
    I'm not sure what I'm doing wrong here - any help is appreciated.
    Regards
    Kamo

    Hi Dan,
    Sorry for causing confusion with my post - it's just that I was asking the same question (with different constraints) as I had asked before so I didn't feel like going to details was necessary because in my post I included a link to the previous thread. Interestingly, I was working on apex.oracle.com when I posted the original thread - the only problem came to be when I started to move the solution to my application on my machine.
    Anyway, thanks for the response!
    Regards
    Kamo

Maybe you are looking for

  • Automatic email confirmation in Training and Event Management

    Hi All, I need to change the Subject and also need to CC the email on customer class registration auto-confirmation. Already configuration has been done to send email when a customer register for training class. But right now the cofirmation email is

  • Information in the Powered by RoboHelp box not displaying

    Hi, While generating FlashHelp, I edited the information displayed when the Powered by RoboHelp icon is clicked from the Help file to include a Help version. While testing, some users reported clicking the icon displayed the information correctly, wh

  • [solved]make error when using svn in PKGBUILD

    Hi, all I want to install the development package of R software using PKGBUILD. My PKGBUILD file is like this: pkgname=r _svnmod=r pkgver=0.0.0 pkgrel=1 pkgdesc="R is a language and environment for statistical computing and graphics" arch=('i686' 'x8

  • DVD Disc Formats

    I have a HP Pavilion laptop with a TOSHIBA DVD-RW optical drive. Can I use DVD-R and DVD+R discs? Thanks Garry

  • Work Flow - FCE to QT then compress and convert to AVI for web upload

    I am creating movie clips that will be 5 to 10 min in length to be streamed on my website. At the current time, my CMS (content management system) for the web cannot accept H.264 (MP4) files, but can accept FLV, AVI and WMV. So, given this constraint