Executing Oracle DB Procedure from JACL Script

May I know if JACL DBAdmin class has method to call stored procedures? I am able to call prepareCall() method from my jacl, however when I call preparecall() method by passing the procedure name as argument it is giving me below error may I know usage of this method.
I am writing below code in jacl
set stmt [$connection prepareCall "{call IOP_Dimension_Load()}"]
where IOP_Dimension_Load is a compiled stored procedure.
2011-01-25 15:39:01.964 NOTIFICATION executing: [invoke external script "Load_etl_tables.jacl"]
2011-01-25 15:39:02.892 ERROR ERROR: status 2
2011-01-25 15:39:02.892 ERROR Error while processing script C:\Oracle\IOP\custom\jacl\Load_etl_tables.jacl
2011-01-25 15:39:02.919 ERROR Stack trace: com.interlacesystems.util.ISException: Error while processing script C:\Oracle\IOP\custom\jacl\Load_etl_tables.jacl
at com.interlacesystems.model.ExternalScriptSupport.createISException(Unknown Source)
at com.interlacesystems.model.ExternalScriptSupport.evaluate(Unknown Source)
at com.interlacesystems.model.ExternalScriptSupport.evaluate(Unknown Source)
at com.interlacesystems.model.ExternalScriptSupport.invoke(Unknown Source)
at com.interlacesystems.model.ExternalScriptSupport.invoke(Unknown Source)
at com.interlacesystems.compiler.ISStatementDispatcher.invoke_clause(Unknown Source)
at com.interlacesystems.compiler.ISStatementDispatcher.statement(Unknown Source)
at com.interlacesystems.compiler.ISStatementDispatcher$ASTStatementRequest.process(Unknown Source)
at com.interlacesystems.scope.Request.execute(Unknown Source)
at com.interlacesystems.compiler.ISStatementDispatcher.multistatement(Unknown Source)
at com.interlacesystems.compiler.StatementRequest.process(Unknown Source)
at com.interlacesystems.scope.Request.execute(Unknown Source)
at com.interlacesystems.compiler.StatementRequest.executeStatement(Unknown Source)
at com.interlacesystems.compiler.StatementRequest$WrapperRequest.process(Unknown Source)
at com.interlacesystems.scope.Request.execute(Unknown Source)
at com.interlacesystems.compiler.StatementRequest.executeStatement(Unknown Source)
at com.interlacesystems.remoteadmin.jws.RemoteAdminSoapImpl$ExecuteCommandWork.run(Unknown Source)
at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
Caused by: javax.script.ScriptException: java.lang.UnsupportedOperationException;
Stacktrace:
tcl.lang.ReflectException
at tcl.lang.JavaInvoke.call(JavaInvoke.java:287)
at tcl.lang.JavaInvoke.callMethod(JavaInvoke.java:121)
at tcl.lang.ReflectObject.cmdProc(ReflectObject.java:914)
at tcl.lang.Parser.evalObjv(Parser.java:818)
at tcl.lang.Parser.eval2(Parser.java:1221)
at tcl.lang.Parser.evalTokens(Parser.java:1001)
at tcl.lang.Parser.eval2(Parser.java:1208)
at tcl.lang.Interp.eval(Interp.java:2222)
at tcl.lang.Interp.eval(Interp.java:2276)
at com.interlacesystems.util.scripting.jacl.JaclScriptEngine.eval(Unknown Source)
at com.interlacesystems.util.scripting.jacl.JaclScriptEngine.eval(Unknown Source)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:195)
at com.interlacesystems.model.ExternalScriptSupport.evaluate(Unknown Source)
at com.interlacesystems.model.ExternalScriptSupport.evaluate(Unknown Source)
at com.interlacesystems.model.ExternalScriptSupport.evaluate(Unknown Source)
at com.interlacesystems.model.ExternalScriptSupport.invoke(Unknown Source)
at com.interlacesystems.model.ExternalScriptSupport.invoke(Unknown Source)
at com.interlacesystems.compiler.ISStatementDispatcher.invoke_clause(Unknown Source)
at com.interlacesystems.compiler.ISStatementDispatcher.statement(Unknown Source)
at com.interlacesystems.compiler.ISStatementDispatcher$ASTStatementRequest.process(Unknown Source)
at com.interlacesystems.scope.Request.execute(Unknown Source)
at com.interlacesystems.compiler.ISStatementDispatcher.multistatement(Unknown Source)
at com.interlacesystems.compiler.StatementRequest.process(Unknown Source)
at com.interlacesystems.scope.Request.execute(Unknown Source)
at com.interlacesystems.compiler.StatementRequest.executeStatement(Unknown Source)
at com.interlacesystems.compiler.StatementRequest$WrapperRequest.process(Unknown Source)
at com.interlacesystems.scope.Request.execute(Unknown Source)
at com.interlacesystems.compiler.StatementRequest.executeStatement(Unknown Source)
at com.interlacesystems.remoteadmin.jws.RemoteAdminSoapImpl$ExecuteCommandWork.run(Unknown Source)
at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
in Load_etl_tables.jacl
at com.interlacesystems.util.scripting.jacl.JaclScriptEngine.eval(Unknown Source)
at com.interlacesystems.util.scripting.jacl.JaclScriptEngine.eval(Unknown Source)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:195)
at com.interlacesystems.model.ExternalScriptSupport.evaluate(Unknown Source)
... 18 more
Thanks,
Sunil

If you look at <install-root>/interlace/jacl/oracle_utils.jacl, there are enough details to see how to execute stored procedure. But these are issues, product doesnt take a particular stand on. You can execute SQL outside and sequence all the scripts (sql, isa, jacl) through shell or perl scripts. It is upto the solution designers to think through.

Similar Messages

  • Execute Oracle Stored Procedure from Excel

    Is it possible to execute an Oracle Stored Procedure from Microsoft Excel and return the result of the Oracle Store Procedure into the excel spreadsheet.

    Yes. You can use Oracle Objects for OLE to accomplish this. It comes with Excel examples and an online help file with many more examples.

  • Executin oracle stored procedure from shell script

    Hi everyone,
    I want to know how to execute a orace stored procedure from a shell script not a sql file.
    Its a oracle stored procedure with in parameters.
    Can anyone send immediate reply its very urgent.
    Thanks in Advance
    with regards
    Thazul

    Hello everyone,
    Whenever i am using the previous script
    because of <<! and !>> in the beginging and the end of oracle scrip. Shell is displaying the error 'newline or ;' unxexpeted and the error no is 48.
    After that i used a different script like
    DIRRUNNER=/oracle/tvg
    count=0
    while [ 1 -eq 1 ]
    do
    for x in `ls $DIRRUNNER/RUNNER_*.TXT`
    do
    count=`grep -c $x $DIRRUNNER/runner.log`
    if [ $count -lt 1 ]
    then
    chstr=`echo $x|awk -F/ '{printf $NF }'`
    dir=$DIRRUNNER
    file=$chstr
    PATH=$PATH:/usr/local/bin:.
    export PATH
    ORACLE_SID=BBPROD
    ORAENV_ASK=NO
    . oraenv
    ORAENV_ASK=YES
    echo "exec runrace('$dir', '$file')" > runner.sql
    sqlplus -s tvgus/tvgus@bbprod @runner.sql
    echo $x >>$DIRRUNNER/runner.log
    fi
    done
    count=0
    sleep 2
    done
    The above one is working fine but after executing the procedure control is still remaing in the sqlplus environment, but i want the control back to my shell
    Can anyone help to resolve this, its pretty urgent.
    Thanks in Advance
    Thazul.
    null

  • Execute oracle stored procedure from C# always returns null

    Hi,
    I'm trying to execute a stored procedure on oracle 9i. I'm using .Net OracleClient provider.
    Apparently, I can execute the stored procedure, but it always returns null as a result (actually all the sp's I have there returns null)! I can execute any text statement against the database successfully, and also I can execute the stored procedure using Toad.
    This is not the first time for me to call an oracle stored procedure, but this really is giving me a hard time! Can anyone help please?
    Below are the SP, and the code used from .Net to call it, if that can help.
    Oracle SP:
    CREATE OR REPLACE PROCEDURE APIECARE.CHECK_EXISTENCE(l_number IN NUMBER) AS
    v_status VARCHAR2(5) := NULL;
    BEGIN
    BEGIN
    SELECT CHECK_NO_EXISTENCE(to_char(l_number))
    INTO v_status
    FROM DUAL;
    EXCEPTION WHEN OTHERS THEN
    v_status := NULL;
    END;
    DBMS_OUTPUT.PUT_LINE(v_status);
    END CHECK_CONTRNO_EXISTENCE;
    C# Code:
    string connStr = "Data Source=datasource;Persist Security Info=True;User ID=user;Password=pass;Unicode=True";
    OracleConnection conn = new OracleConnection(connStr);
    OracleParameter param1 = new OracleParameter();
    param1.ParameterName = "v_status";
    param1.OracleType = OracleType.VarChar;
    param1.Size = 5;
    param1.Direction = ParameterDirection.Input;
    OracleParameter param2 = new OracleParameter();
    param2.ParameterName = "l_number";
    param2.OracleType = OracleType.Number;
    param2.Direction = ParameterDirection.Input;
    param2.Value = 006550249;
    OracleParameter[] oraParams = new OracleParameter[] { param1, param2 };
    OracleCommand cmd = new OracleCommand("CHECK_EXISTENCE", conn);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddRange(oraParams);
    conn.Open();
    object result = cmd.ExecuteScalar();
    conn.Close();

    Hi,
    Does that actually execute? You're passing two parameters to a procedure that only takews 1 and get no error?
    Your stored procedure doesnt return anything and has no output parameters, what are you expecting to be returned exactly?
    If you're trying to access V_STATUS you'll need to declare that as either an output parameter of the procedure, or return value of the function, and also access it via accessing Param.Value, not as the result of ExecuteScalar.
    See if this helps.
    Cheers,
    Greg
    create or replace function myfunc(myinvar in varchar2, myoutvar out varchar2) return varchar2
    is
    retval varchar2(50);
    begin
    myoutvar := myinvar;
    retval := 'the return value';
    return retval;
    end;
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    public class odpfuncparams
         public static void Main()
          OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl");
          con.Open();
          OracleCommand cmd = new OracleCommand("myfunc", con);
          cmd.CommandType = CommandType.StoredProcedure;
          OracleParameter retval = new OracleParameter("retval",OracleDbType.Varchar2,50);
          retval.Direction = ParameterDirection.ReturnValue;
          cmd.Parameters.Add(retval);
          OracleParameter inval = new OracleParameter("inval",OracleDbType.Varchar2);
          inval.Direction = ParameterDirection.Input; 
          inval.Value="hello world";
          cmd.Parameters.Add(inval);
          OracleParameter outval = new OracleParameter("outval",OracleDbType.Varchar2,50);
          outval.Direction = ParameterDirection.Output;
          cmd.Parameters.Add(outval);
          cmd.ExecuteNonQuery();
          Console.WriteLine("return value is {0}, out value is {1}",retval.Value,outval.Value);
          con.Close();
    }

  • Execute ORACLE STORE PROCEDURE from DATABASE

    Hi Everyone...
    i have a store procedure, it has a 5 params, 3 are IN parameters and 2 left are OUT parameters, I need execute this store procedure using a SQL Intruction like this
    DECLARE integracion_sia_kac PROCEDURE FOR KACTUS.SP_SIAKAC_NMDHODO
    :ll_horario,
    :ll_ide_doc,
    :ls_con_kac,
    @PINDREGI=:ls_ind_registro output, @PVALERRO=:ls_error_int output
    USING gt_kactus;
    i think this function is using from MSSQL Server, this has a three IN params but the declaration of the OUT params I don't understand.
    HELP ME!!!!!.... I need know way to execute the SP
    Thanks

    Well it is very simple!
    example:
    CREATE OR REPLACE PROCEDURE PROC1 (P1 IN NUMBER, P2 IN NUMBER, P3 OUT NUMBER) IS
    BEGIN
    P3 := P1 + P2;
    END;
    This is how to use PROC1 from, say, PROC2 :
    CREATE OR REPLACE PROCEDURE SomeShema.PROC2 IS
    Var1 NUMBER(15,2);
    Var2 NUMBER(15,2);
    ReturnParamFromPROC1 NUMBER(15,2);
    BEGIN
    Select SomeField INTO Var1 from Table1 where Table1.ID = 10;
    Select SomeField INTO Var2 from Table2 where Table2.ID = 20;
    PROC1(Var1, Var2, ReturnParamFromPROC1);
    DBMS_OUTPUT.PUT_LINE('Returned value from PROC1 is : '||ReturnParamFromPROC1);
    END;

  • Executing set of procedures from Shell script.

    Hi,
    I've set of procedures which i need to pass a parameter from the os ..like this.
    For table XXX ...i need to call
    a Procedure XXX ('parameter as file name ')..
    So i've a test.sql file which is calling
    EXEC XXX(&1);
    The Shell script file will be like this...
    sqlplus username/password @test.sql
    Like this i need to call 10 tbles.
    so 10 sql file and 10 shell script file.
    And also i need to scedhule the *.sh file.
    Is that a right way ....? or any other method to achive this ????
    IT'S URGENT...
    Thanks

    Hi,
    Make a file proc.txt containing the name of the proc :
    proc1
    proc2
    proc3
    A second file for the tables names tables.txt containing :
    table1
    table2
    table3
    And the shell will be :
    #!/bin/bash
    TAB=tab.txt
    PROC=proc.txt
    for THE_TABLE in `cat $TAB`
    do
    for THE_PROC in `cat $PROC`
    do
    sqlplus system/manager <<!
    exec $THE_PROC ;
    exit ;
    done
    done
    Fred
    ~
    ~

  • How to execute oracle stored procedure through php as externally?

    hi...
    i am searching for the way that how to execute oracle stored procedure through web service, i am using php and mysql, i have some stored procedures in oracale database, i want to execute them, from php, means the database will be remain mysql, and the stored procedures of oracle will be executed externally...
    Kind regards,
    Wilayat.

    Ok, so first of all this is a kind of strange question. Since Oracle and MYSQL can happily live side by side.
    Make sure you have the oracle client (instant or regular ) installed and OCI_8 is set up and working correctly in PHP. If it is, when you run the phpinfo() routine you will see oci_8 on there. IF PHP connects just fine from the command line yet apache wont connect check permissions and things like the LD_Library Path.
    Then in php, right along with your MySQL statements run Oracle Statements eg:
    <?php
    $OraDB = oci_connect(name,pass,tnsname);
    $MySQLdb = mysql_connect([parms]);
    $oraQueryText = "begin sp_some_proc([some parms]); end;" ;
    $mysqlQuery = " Some mysql Query";
    $oraQuery = oci_parse($OraDB,$oraQueryText );
    oci_execute($oraQuery);
    mysql_execute([parms]);
    ?>
    Use the standard fetch code to get data from either of them.
    If you cannot and I mean absolutely cannot get an admin to link in OCI_8 then you still have recourse although it will be tedious as hell. PHP allows you to exec calls to the OS. You still MUST make sure the Oracle Client is installed and that sqlplus runs from the command line. You will more then likely have to have a shell script written to do this as well, but maybe not as I have never tried it with the exception of capturing the return value of sqlplus and you will have to dig into sqlplus to get it to send its results to a file you can then parse with php.
    Good Luck!

  • Error while executing a stored procedure from forms6i

    When I execute a STORED PROCEDURE from ORACLE DB 10g this procedure works perfectly fine.
    But when I execute the same from the FORMs 6i I get the following error:
    PDE-PLU022 Don't have access to the stored program unit
    XMLPARSERCOVER in schema CARE.
    where XMLPARSERCOVER is the class and
    CARE is the schema.
    Regards,
    Jignesh S

    I have tried this with both the owner of the schema and the intended user, -from both forms and directly.
    All rights was granted on the stored procedure. Since posting I have found that one of the tables that the procedure might insert into, was not explicitly granted to the intended user, and after rectifying that the error message went away.
    -however, the procedure now silently "finishes" without any evidence that it ever ran, if invoked from the forms application. When invoked from SQL Plus (or JDev, or Toad) it runs as expected.
    I have no public synonym for the procedure, -is that necessary?
    The stored procedure in question is implemented in java, and published as a stored procedure. It does rather heavy lifting, when running, using a view against another server , updating local tables and quite a lot of data validation/cleansing, and logging. All recourses are within the same schema.
    Any ideas?

  • Invoking Oracle stored procedures from within a JDBC channel for PI 7.1

    Hi ,
    Can anybody tell me that is it possible to invoke Oracle stored Procedure from within a JDBC  sender channel for PI 7.1.
    Its working in XI3.0 and XI 7.0 for Oracle DBMS versions >= 10.2.x. But I am not sure,whether it will work for PI 7.1 also.
    Thanks & Regards,
    Saru

    HI,
    refer below link,there is no much difference in PI7.1 ,executing stored procedure is same .
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b72b2fde93673e10000000a114a6b/content.htm
    Regards,
    Raj

  • Problem in calling Oracle stored procedure from Java.

    I am trying to invoke the Oracle stored procedure from Java. The procedure does not take any parameters and does not return anything. If I call it from SQL prompt it is working perfectly. I am calling it in my program as follows.
    callable_stmt=con.prepareCall("{call pkg_name.proc_name()}");
    callable_stmt.execute();
    The problem is the control-of-flow is getting strucked in the second line I wrote. It is not giving any error also.
    Please clarify me what's wrong with my code?
    Seenu.

    And how long does the stored procedure take to run from your client machine when running it via sqlplus?

  • Execute a stored procedure from a JSP.(Help...)

    How can I execute a stored procedure from a JSP.
    Wich tags I need to use ???
    I'm using the oracle thin JDBC.
    please help me.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Mario Bellido ([email protected]):
    How can I execute a stored procedure from a JSP.
    Wich tags I need to use ???
    I'm using the oracle thin JDBC.
    please help me.<HR></BLOCKQUOTE>
    I just try a simple call with a data tag just like this (see category.jsp in the onlineorder example provided with Jdev 3.2.3):
    <!-- Tutorial - ApplicationModule Tag -->
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <jbo:ApplicationModule configname="OnlineOrders.OnlineOrdersModule.LocalConfig" id="OnlineOrdersModule" username="BC4J" password="BC4J" />
    <!-- Tutorial - DataSource Tag -->
    <jbo:DataSource id="category" appid="OnlineOrdersModule" viewobject="CategoryView" ></jbo:DataSource>
    <jbo:ExecuteSQL appid="OnlineOrdersModule" >
    insert into tablejsp values ('testtable')
    </jbo:ExecuteSQL>
    <jbo:ExecuteSQL appid="OnlineOrdersModule" >
    call testjsp()
    </jbo:ExecuteSQL>
    <jbo:Commit appid="OnlineOrdersModule" />
    testjsp is a stored PL/SQL procedure without arguments.
    null

  • Error ORA-04031 while executing a stored procedure from Pro C++ code

    I am getting the error ORA-04031(Unable to allocate 4096 bytes of shared memory("Shared Pool",.....)) while trying to execute a stored procedure from my pro*C application. This happens only after a few hours since the application has been running. I am closing the cursor after every database call.
    Does anyone know why it is happening and any possible solutions?
    TIA
    Srithaj.

    One thing that can be done is to flush the shared pool before starting the application.
    alter system flush shared pool;
    Another is to increase the shared pool size by setting the parameter shared_pool_size in init_sid.ora file.
    null

  • Executing a stored procedure from a java program

    Hi.. how can i call a oracle stored procedure from a java
    program. the OSP has four IN parameters and one OUT parameter(a
    cursor). when i try this way.. i get an error
    con = DriverManager.getConnection(url, "stored", "stored");
    CallableStatement cs =
    con.prepareCall(
    "{call stored_proce_1(?,?,?,?,?)}");
    cs.registerOutParameter(1, OracleTypes.CURSOR);
    cs.setString(2, "14541");
    cs.setString(3, "gen");
    cs.setInt(4, 0);
    cs.setInt(5, 5);
    ResultSet rs =cs.getResultSet();
    while(rs.next()){
    System.out.println(rs);
    appreciate ur help.
    qs

    I'm no expert on this, but I have a similar call where I fetch
    an Oracle REF CURSOR from a call to a stored function. If you
    fetch the cursor as an Object from your CallableStatement, you
    can then cast it to a ResultSet e.g.
    mystatement.executeUpdate();
    ResultSet rs = (ResultSet) mystatement.getObject(1);
    Then you should be able to loop through your ResultSet as usual.
    Good luck!
    Chris

  • Calling Oracle stored procedure from xMII Query Templates.

    Hi All,
    We have a requirement to call a Oracle stored procedure from xMII, the SP expects some inputs and then it returns multiple rows.
    I tried different approches with no results, I remember some posts on the same topic but I could not get in search results.
    Looking for some help in this regards
    Rupesh.

    Hi Rupesh Bajaj,
    In oracle stored procedure we have to use Packages..if you used packages the u have to assign to some variable.
    To calling Stored procedure  in Query Template is CALL Testing('[Param.1]','[Param.2]',,:X)
    In above line Testing is Stored procedure name and Param.1 is parameters and X is Package.
    Thanks
    Ravilla Ramesh

  • Calling Oracle store procedure from Crystal 11 command

    I need to call Oracle store procedure from Crystal Command. The Store proc has ref cursor. Is it possible. Can you post few examples?
    Also, is it possible to have multiple sql statements in a Crystal Command, when working with Oracle 10g?
    It is working for SQL server.

    Please re-post if this is still an issue to the Data Connectivity - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly.

Maybe you are looking for

  • C100 LDAP accept to multiple AD domains?

    Hi All, Just been settings up our Ironport c100 and noticed that per listener you can only have one LDAP lookup host (or many in failover) however what we require is the following: Inbound e-mail for [email protected] c100 lookups AD (LDAP) of domain

  • Cannot access Time Machine backups on new MacBook Pro

    Hey, I'm new to the forums, just wanting to throw it out there. But to the point- Yesterday, I purchased a new MacBook Pro. I upgraded from a regular MacBook. I want to keep my Music, Pictures, and other Documents, so I used Time Machine to make an i

  • Background color change to grey after iOS 7.01 upgrade

    Hi all, Updgraded to 7.01 this morning, and what used to be this beautiful tranparent background become this ugly grey. All else is functioning normally. Did something go wrong during the upgrade or is this an intended change? Need to solve this plea

  • Nokia express 5800 bluetooth problem

    hi all my problem with my nokia 5800 express music is when i try to open the bluetooth it gives me a error message which says unable to preform blutooth operation and before it was already working , and i already upgraded the new version as try that

  • BAPI monitoring

    HI experts In file business req I developed scenario like JDBC--XI--R/3(RFC). In my scenario data is send to R/3 using BAPI(RFC) from XI using receiver RFC adapter. So How Can I check whether data is saved or not in R/3 Database. How we can see the B