Trigger error in a call store procedure (ORA-06512)

Hi all,
I have a trigger (TRLFACTSIN) that update stock when delete, insert or update a record in a sales table. Inside the trigger call a store procedure (PCALCULASTOCK2), he is the manager of calculating and update the stock .
Any idea?, Thanks
Error description:
UPDATE "ALCAR"."LFACTSIN" SET CANTIDAD = '10' WHERE ROWID = 'AAA0D9AAAAAACvdAAA'
One error saving changes to table "ALCAR"."LFACTSIN":
Row 7: ORA-04091: table ALCAR.LFACTSIN is mutating, trigger/function may not see it
ORA-06512: at "ALCAR.PCALCULASTOCK2", line 114
ORA-06512: at "ALCAR.TRLFACTSIN", line 31
ORA-04088: error during execution of trigger 'ALCAR.TRLFACTSIN'
Trigger DDL:
create or replace
Trigger trLFACTSIN
AFTER INSERT OR DELETE OR UPDATE ON LFACTSIN
for each row
Declare
darticulo varchar2(13);
resultado integer default 0;
bEjecutar boolean default True;
ofic1 char(1);
begin
if (inserting) then
darticulo := :new.cod_articulo;
ofic1 := :new.oficial;
end if;
If (deleting) Then
darticulo := :old.cod_articulo;
ofic1 := :old.oficial;
end if;
If (Updating) Then
-- En el caso que sea actualización miramos si la se modificó la cantidad
if :old.cantidad = :new.cantidad Then
darticulo := '';
bEjecutar := False;
else
darticulo := :new.cod_articulo;
ofic1 := :new.oficial;
end if;
end if;
--Ejecutamos el procedimiento almacenado para actualizar el stock en el semielaborado
If bEjecutar Then
--Comprobamos si es semielaborados
Select Count(*) into resultado from semielab Where cod_semielab = darticulo;
-- Ejecutamos el procedimiento almacenado que calcula y actualiza el stock para el semielaborado
If resultado <> 0 Then
PCALCULASTOCK2(darticulo, ofic1);
resultado:=0;
end if;
End If;
End;

Whilst the table with the trigger on it is in the middle of a transaction you cannot select or use DML against it. This is what Oracle calls a "mutating table". It doesn't make sense to try and use a table that is in the middle of changing.
You can use an autonomous transaction to work around this issue, but you should be careful with autonomous transactions because there are drawbacks relating to maintaining transaction consistency. Effectively it means you will be making alterations to B based on the fact that A has happened, but the transaction on B will not get rolled back if A fails at any point which could leave you with A not complete but B complete, hence the inconsistency.

Similar Messages

  • ADF 11, USING EJB, CALL STORE PROCEDURE, A PROBLEAM?

    ADF 11, USING EJB, CALL STORE PROCEDURE, A PROBLEAM?
    I have a store procedure:
    CREATE OR REPLACE PACKAGE BODY PK_HR1
    IS
    FUNCTION FUNC04
    RETURN CUR_RESULT
    IS
    X_CUR CUR_RESULT;
    BEGIN
    OPEN X_CUR FOR
    select mako, tenko, diachiko from kho;
    RETURN X_CUR;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE;
    END FUNC04;
    END PK_HR1;
    In the entities class, I have a NamedStoredProcedureQuery:
    @Entity
    @NamedStoredProcedureQuery(name="Kho.FUNC04",
              resultClass=Kho.class,
              procedureName="PK_HR1.FUNC04" )
    public class Kho implements Serializable {
    In session bean, i have a method
    public class SessionEJBBean implements SessionEJB, SessionEJBLocal
    public void test() throws Exception{
    try {
    //code here ...
    List<Kho> listKho = em.createNamedQuery("Kho.FUNC04").getResultList();
    System.out.println("aaaa");
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {
    I try running, but always show errror
    this errors:
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00221: 'FUNC04' is not a procedure or is undefined
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call: BEGIN PK_HR1.FUNC04(); END;
    Query: ReadAllQuery(jp.co.mfr.sgs.bean.Kho)
    help help me?

    You need to use a CallableStatement for this.
    --olaf                                                                                                                                                                                                           

  • About JDBC CALL STORE PROCEDURE with out parameter is greater than 4000

    Hi Guys,
    I have a problem call store procedure with a large string.
    as i know varchar2 can contain 32767 characters in pl/sql .
    But when i used varchar2 as a out parameter in a store procedure, if the out parameter is greater than 4000 characters , it always give me error message as 'the buffer is too small'.
    why it happened?
    I read some article that says i need configure a property in data-source.xml , and jdbc 10g driver already solved this problem, but i used jdev 10.1.3.2 ,the driver should be fine.
    How can i solve this problem?
    Thanks in advance,
    AppCat

    Object is Foundation, Execute Script
    This is for a query, you can change to a stored procedure call. Pull the value back in the Java code then put into the process variable.
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import java.sql.*;
    PreparedStatement stmt = null;
    Connection conn = null;
    ResultSet rs = null;
    try {
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("java:IDP_DS");
    conn = ds.getConnection();
    stmt = conn.prepareStatement("select FUBAR from TB_PT_FUBAR where PROCESS_INSTANCE_ID=?");
    stmt.setLong(1, patExecContext.getProcessDataLongValue("/process_data/@inputID"));
    rs = stmt.executeQuery();
    rs.next();
    patExecContext.setProcessDataStringValue("/process_data/outData", rs.getString(1));
    } finally {
    try {
    rs.close();
    } catch (Exception rse) {}
    try {
    stmt.close();
    } catch (Exception sse) {}
    try {
    conn.close();
    } catch (Exception cse) {}

  • To call Store procedure

    I log in in the Enterprise manager with the user "Nadia" that I created . I Created an escheme TEST and all the tables .
    I Created also the package with this user. It has a procedure that returns 1 cursor.
    This user has:
    atributte: CONNECT, DBA AND RESOUCE
    System: EXECUTE ANY PROCEDURE AND UNLIMITED TABLESPACE
    Is it correct?
    My application is access the oracle 9i with this user too.
    I have to call the procedure this way:
    SID.PACKAGE.PROCEDURE
    Im my vb code, I am call this way too.
    Code VB 6:
    With cmd
    .ActiveConnection = CNP
    .CommandText = "NADIA.EXT_DADOS.DADOS_VISITANTE" ????
    .Prepared = False
    .CommandType = adCmdStoredProc
    .Parameters.Append .CreateParameter("@Documento", adInteger, adParamInput, 15, 8384474)
    .Parameters.Append .CreateParameter("@nome", adChar, adParamInput, 1, lsTipo)
    Set ObReg = .Execute(, , adAsyncFetchNonBlocking)
    End With
    When execute, message errors show:
    The NADIA.EXT_DADOS.DADOS_VISITANTE needs to be declared.
    Wha is wrong?
    thank you
    Nádia

    It looks like you are getting appropriate feedback in one of the other threads on this topic that you've posted:
    To call Store procedure
    But I would have to say that I hope this is just a test system. I would never grant DBA, EXECUTE ANY PROCEDURE, and UNLIMITED TABLESPACE to a "normal" user in a production system.
    Good luck,
    Mark

  • How to call store procedure in query generator

    Hi All,
    How to call store procedure in query generator.
    Regards
    Rajkumar Gupta
    Edited by: Rajkumar Gupta on Dec 7, 2010 2:11 AM

    Hi,
    Please check the following threads.
    How to use Stored Procedure in sap business one
    How to add parameters to a stored procedure in B1 Query generator
    How to execute the procedure in sap b1
    Hope it helps,
    Vasu Natari.

  • Error w/ UPDATE in Stored Procedure - ORA-06553 PLS-306

    I get the following error when executing my stored proc. from a Perl script:
    DBI ERROR: ORA-06553: PLS-306: wrong number or types of arguments in call to 'UPDATE_USER_PROJMGR' (DBD ERROR: OCIStmtExecute),
    QUERY: DBI::st=HASH(0x238cd4)Now, it's passing the correct number of values, the UPDATE stmt stores them in the proper order and the procedure when created showed it was done so with no errors.
    What value could be out of whack with Oracle here? I don't get it. If anyone sees what I'm doing wrong here, please suggest it.
    Thanks!
    Here's my stored proc.
    CREATE OR REPLACE PROCEDURE UPDATE_USER_PROJMGR
    (dp_regleg IN DEFAULT_PROJECT_USER.REG_LEGAL%type,
    dp_netcred IN DEFAULT_PROJECT_USER.NETCRED_LOSS%type,
    dp_expreduc IN DEFAULT_PROJECT_USER.EXPENSE_REDUC_CKB%type,
    dp_stratgoal IN DEFAULT_PROJECT_USER.STRAT_GOALS%type,
    dp_audcompl IN DEFAULT_PROJECT_USER.AUDIT_COMPL%type,
    dp_revgen IN DEFAULT_PROJECT_USER.REV_GEN%type,
    dp_cacs IN DEFAULT_PROJECT_USER.CACS%type,
    dp_custit IN DEFAULT_PROJECT_USER.CUSTOMIT%type,
    dp_custimpact IN DEFAULT_PROJECT_USER.CUST_IMPACT%type,
    dp_callmgt IN DEFAULT_PROJECT_USER.CALL_MGT%type,
    dp_calltrk IN DEFAULT_PROJECT_USER.CALL_TRACK%type,
    dp_citilink IN DEFAULT_PROJECT_USER.CITILINK%type,
    dp_desktop IN DEFAULT_PROJECT_USER.DESKTOP%type,
    dp_dialer IN DEFAULT_PROJECT_USER.DIALER%type,
    dp_dri IN DEFAULT_PROJECT_USER.DRI%type,
    dp_engr IN DEFAULT_PROJECT_USER.ENGINEER%type,
    dp_img IN DEFAULT_PROJECT_USER.IMAGING%type,
    dp_ipdt IN DEFAULT_PROJECT_USER.IPDT%type,
    dp_mainfram IN DEFAULT_PROJECT_USER.MAINFR%type,
    dp_miscoth IN DEFAULT_PROJECT_USER.MISC_OTHER%type,
    dp_mortserv IN DEFAULT_PROJECT_USER.MORTSERV%type,
    dp_mortweb IN DEFAULT_PROJECT_USER.MORTWEB%type,
    dp_nonmortserv IN DEFAULT_PROJECT_USER.NON_MORTSERV%type,
    dp_origplat IN DEFAULT_PROJECT_USER.ORIG_PLAT%type,
    dp_qualmapping IN DEFAULT_PROJECT_USER.QUAL_MAP%type,
    dp_datawarehse IN DEFAULT_PROJECT_USER.DATAWARE_REPTS%type,
    dp_servappvend IN DEFAULT_PROJECT_USER.SERV_APP_VDR%type,
    dp_sbend IN DEFAULT_PROJECT_USER.SOUTHBEND%type,
    dp_websvcg IN DEFAULT_PROJECT_USER.WEB_SVCG%type,
    dp_projmgr IN DEFAULT_PROJECT_PROJMGR.PROJ_MGR%type,
    dp_status IN DEFAULT_PROJECT_PROJMGR.STATUS%type,
    dp_projtype IN DEFAULT_PROJECT_PROJMGR.IT_PROJ_TYPE%type,
    dp_projnum IN DEFAULT_PROJECT_PROJMGR.IT_PROJNUMBER%type,
    defprodid IN NUMBER)
    IS BEGIN
    -- UPDATE STATEMENT
    UPDATE DEFAULT_PROJECT_USER SET
    REG_LEGAL = dp_regleg, NETCRED_LOSS = dp_netcred,EXPENSE_REDUC_CKB = dp_expreduc, STRAT_GOALS = dp_stratgoal, AUDIT_COMPL = dp_audcompl,
    REV_GEN = dp_revgen,CACS = dp_cacs, CUSTOMIT = dp_custit, CUST_IMPACT = dp_custimpact,CALL_MGT = dp_callmgt,
    CALL_TRACK = dp_calltrk,CITILINK = dp_citilink,DESKTOP = dp_desktop,DIALER = dp_dialer,DRI = dp_dri,
    ENGINEER = dp_engr,IMAGING = dp_img,IPDT = dp_ipdt,MAINFR = dp_mainfram,MISC_OTHER = dp_miscoth,MORTSERV = dp_mortserv,
    MORTWEB = dp_mortweb,NON_MORTSERV = dp_nonmortserv,ORIG_PLAT = dp_origplat,QUAL_MAP = dp_qualmapping,DATAWARE_REPTS = dp_datawarehse,
    SERV_APP_VDR = dp_servappvend,SOUTHBEND = dp_sbend,WEB_SVCG = dp_websvcg
    WHERE DEFPROJ_ID = defprodid;
    UPDATE DEFAULT_PROJECT_PROJMGR SET
    PROJ_MGR = dp_projmgr,STATUS = dp_status,IT_PROJ_TYPE = dp_projtype,IT_PROJNUMBER = dp_projnum
    WHERE DEFPROJ_ID = defprodid;
    COMMIT;
    END UPDATE_USER_PROJMGR;
    /Here's my Perl script callable stmt:
    my $sth2 = $dbh->prepare(q{CALL UPDATE_USER_PROJMGR(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)});
    $sth2->execute($reglegal,$netcredloss,$expreduc,$stratgoal,$audcomp,$revgen,$cacs,$custit,$custimp,$callmgt,$calltrkl,$citlink,$deskt,$dialer,$dri,$engineering, $imaging,$ipdt,$mframe,$miscoth,$mortserv,$mortweb,$nonmortserv,$origpltfrm,$qualmap,$dataware,$servapp,$sbdev,$websvcg,$projmgr,$status,$itprojtype,$itprojnum)or do {
    print('err', "<img src='../spacer.gif' width='1' height='150'>ERROR: Could not execute SQL! Error: " . $dbh->errstr);
               };and the values getting passed:
    Holly Spradlin
    Withdrawn
    PRF
    1222
    Y
    Y
    N
    N
    Y
    Y
    Y
    N
    Y
    N
    N
    N
    Y
    N
    N
    N
    N
    N
    Y
    Y
    Y
    N
    N
    N
    N
    N
    N
    N
    NI get no compile errors or anything until I submit the form to update.
    Any help would be appreciated...if I get it solved, I'll reply right away - thanks.

    try manually executing the procedure to check for the
    errors
    SQL> execute UPDATE_USER_PROJMGR('Holly
    Spradlin','Withdrawn','PRF',1222,'Y','Y','N','N','Y',
    Y','Y','N','Y','N','N','N','Y','N','N','N','N','N','Y'
    ,'Y','Y','N','N','N','N','N','N','N','N');3360 is right you have only supplied 33 parameters
    while your procedures requires 34 parameters.ok, did this and did get the error:
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'UPDATE_USER_PROJMGR'
    ORA-06550: line 1, column 7:but I wonder why I can't specify the ID value as my sequence's currval - ?
    Let me doublecheck my sequence.
    OK, I got it!!! thanks, guys, for all your help!!
    I just needed to back to the callable statement in the perl script itself and add the last ID param.
    Thanks for pointing that out!!
    Message was edited by:
    user515689

  • How I can call Store procedure by TABLENAME.FIELD_VALUE ?

    Hello,
    I have one table called store_proc_list.
    In the table there are two fields ie ID, SP_NAME.
    In SP_NAME I have set the store procedure name.
    Now,
    What I wanted to do is .
    I am writting one store procedure and in that
    and I want to execute the another store procedure (by name), which I will get from
    SELECT sp_name FROM store_proc_list WHERE id=1
    How I can do it ?
    I tried to do it but I could not get that how we can execute stored procedure by the name which I will get from the table.field_value for the specified condition.
    sample will more helpful.
    Thanks
    Kamlesh Gujarathi
    [email protected]

    I am curious to know how does Execute immediate help in executing the stored prod dynamically...
    SQL>CREATE OR REPLACE PROCEDURE test_proc1
    2 AS
    3 BEGIN
    4 DBMS_OUTPUT.PUT_LINE('This is test_proc1');
    5 END;
    6 /
    Procedure created.
    SQL>
    SQL>CREATE OR REPLACE PROCEDURE test_proc2
    2 AS
    3 lv_proc_name VARCHAR2(30) := 'TEST_PROC1';
    4 BEGIN
    5 EXECUTE IMMEDIATE lv_proc_name;
    6 END;
    7 /
    Procedure created.
    SQL>sho err;
    No errors.
    SQL>
    SQL>exec test_proc2;
    BEGIN test_proc2; END;
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at "AIP.TEST_PROC2", line 5
    ORA-06512: at line 1
    Regards
    Arun

  • Calling store procedure using class cl_sql_statement not running

    Hello together
    i want to call a stored procedure that has an input and an output parameter but when i using my coding i m getting the following error
    ORA-06550: line 1, column 7:#PLS-00201: identifier 'STORED_PROC_NAME' must be declared#ORA-06550: line 1, column 7:#PL/SQL: Statement ignored
        GET REFERENCE OF lv_input  IN lr_dref."in
        lr_cl_sql_statement->set_param( data_ref = lr_dref
                            inout    = cl_sql_statement=>C_PARAM_IN ).
       GET REFERENCE OF lv_out INTO lr_dref. "out
        lr_cl_sql_statement->set_param( data_ref = lr_dref
                            inout    = cl_sql_statement=>C_PARAM_OUT ).
        TRY.
          data lv_ROWS_PROCESSED type i.
        CALL METHOD LR_CL_SQL_STATEMENT->EXECUTE_PROCEDURE
          EXPORTING
            PROC_NAME      ='Stored_Proc_Name'
          RECEIVING
            ROWS_PROCESSED = lv_ROWS_PROCESSED
    i my oppinion there could be an error in setting the parameters. Has anyone an running solution for calling a stored procedure with in and out parameter. I already tested the ADBC Programs and even had a sight in the class documentation but there is no example with in and output parameter.
    Thank your for your help!

    Hi
    Not sure as the exact  solution , but you can try the following :
    You are executing the "stored procedure"  as which user , is it under your schema and do you have execute priveleges on it.
    Please see below links , might be helpful to you :
    http://forums.devshed.com/java-help-9/call-stored-procedure-337312.html
    http://bytes.com/topic/oracle/answers/643380-pls-00201-identifier-user-procedure-name-must-declared
    Thanks
    Rishi

  • Problem of retrieve a set of data when calling store procedure using vb with ODBC

    when I use ODBC, it can return 1 record (1 field) using pass and retrieve the parameter. but it cannot success when return a set of data (using recordset to store it), when i do it, the error message (Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if availabl. No work was done.). Why ? and how can solve it ?\
    Thanks in advance.

    oh, really ? it is not use ODBC to connecto to oracle ?
    Here is my program code:
    STORE PROCEDURE:
    PROCEDURE getInforcePolicy(PClient_ID IN VARCHAR2, PPolicy_No IN VARCHAR2, BasicCur OUT oraoledb.m_refcur, RiderCur OUT oraoledb.m_refcur)
    IS
    BEGIN
    OPEN BasicCur FOR SELECT * FROM
    inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No = 1;
    OPEN RiderCur FOR SELECT * FROM
    inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No <> 1;
    END getInforcePolicy;
    PACKAGE oraoledb AS
    TYPE m_refcur IS REF CURSOR;
    END oraoledb;
    Program:
    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim rs2 As New ADODB.Recordset
    Dim cmd As New ADODB.Command
    Dim paramclient As New ADODB.Parameter
    Dim parampolicy As New ADODB.Parameter
    Dim I As Integer
    cn.Open "ridev", "abc","abc"
    cmd.ActiveConnection = cn
    Set paramclient = cmd.CreateParameter("PClient", adVarChar, adParamInput, 10)
    Set parampolicy = cmd.CreateParameter("PPolicy", adVarChar, adParamInput, 10)
    paramclient.Value = "0000023011"
    parampolicy.Value = "HK0010021U"
    cmd.Parameters.Append paramclient
    cmd.Parameters.Append parampolicy
    cmd.CommandText = "{call getInforcePolicy}"
    Set rs = cmd.Execute
    Do While Not rs.EOF
    Loop
    Set rs2 = rs.NextRecordset
    Do While Not rs2.EOF
    loop
    Where the RIDEV is a datasource that created from Data Source in Control Panel using the driver call "Microsoft ODBC for ORACLE"

  • Call store procedure wich have parameter from html

    Hi all,
    I have search function, which will allow users to select all database.
    I want to use stor procedure to handle this part , if it is a sample select procedure than just using
    CallableStatement cs = conn.prepareCall("{call SHow_SubType}");
                     ResultSet rs = cs.executeQuery();but if the store procedure have parameter
    like
    union 
    select FieldNumber, Name, HiTiter, SubType, Storage,SampleRegion, SampleYear
            from yunnan.dbo.ViruName04    
         where SubType like'%@SubType%'        
            and Name like'%@Name%'How can I call this stored procedure in my bean
    I have
    public String getName() {
        return name;
      public void setName(String _name) {
        name = _name;
    .....thankyou

    Hi ram,
    I try every hard, but still can't got result.
    my code is
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import javax.sql.*;
    * TryJdbc.java
    * This servlet demonstrates using JDBC
    public class displayT extends HttpServlet {
       CallableStatement cs = null;
        ResultSet rs = null;
        Connection conn = null;
       * We want to initialized the JDBC connections here
        public void init()
            try{
            Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
            catch( Exception e )
                e.printStackTrace();
       * This responds to an HTTP GET request.
        public void doGet(
        HttpServletRequest req,
        HttpServletResponse response)
        throws IOException, ServletException {
           String string= req.getParameter("string").trim();             
           String Type =req.getParameter("myType").trim();
            response.setContentType("text/html");
        PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head>");        
            try{
                conn = DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433;selectMethod=cursor","test","1234" );
                DatabaseMetaData md = conn.getMetaData();
                //select a database
                conn.setCatalog("HKData");
           //we made it!
            out.println("connection established sucessfully!");
                CallableStatement cs = conn.prepareCall("call SHow_SubType(?,?)}");
                  cs.setString(1, "Dk");
                   cs.setString(2,"H5");
              // register int OUT parameter
         cs.registerOutParameter( 1, java.sql.Types.VARCHAR);
         cs.registerOutParameter( 2, java.sql.Types.VARCHAR);
                     ResultSet rs = cs.executeQuery();       
                  rs = (ResultSet)cs.getObject(1);
          while(rs.next()) {
          // String Name=rs.getString(2);    
           // out.print(""+Name+"");
           // out.print("br");
           System.out.println(rs.getString(1));
            out.print("</body></html>");
              out.close();
         cs = null;
    conn.close();
    conn = null;
    catch(NullPointerException sqle)
    sqle.printStackTrace();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println("error in finding class "+ex);
    public void doPost(HttpServletRequest Request, HttpServletResponse Response)
                    throws ServletException, IOException {
    public String getServletInfo()
        return "A Simple Servlet";
    }what is the psooible mistake , I use SQL2000.
    Thank you

  • DBMS_LDAP call fails with ORA-06512 Error Mapping function

    Hi,
    I am facing a problem with workflow integration with LDAP.
    I receive
    ORA-6512 Error Mapping Function on one particular line within the WF_LDAP.get_cfg_val procedure.
    WHILE my_entry IS NOT NULL
    LOOP
    my_vals := DBMS_LDAP.get_values (p_session,
    my_entry,
    p_name);
    The documentation says:
    ORA-06521 PL/SQL: Error mapping function
    Cause: An error was detected by PL/SQL trying to map the mentioned
    function dynamically.
    Action: Check the stacked error (if any) for more details.
    This is the trace of the error:
    ORA-06521 PL/SQL Error mapping Function
    ORA-06512 at SYS.DBMS_LDAP_API_FFI line 0
    ORA-06512 at SYS.DBMS_LDAP line 1332
    ORA-06512 at SYS.DBMS_LDAP line 1302
    ORA-06512 at SYS.DBMS_LDAP line 582
    This is the header of the catldap.sql file
    Rem
    Rem $Header: catldap.sql 07-jan-2000.19:15:20 akolli Exp $
    Rem
    Rem catldap.sql
    Rem
    Rem $Header: dbmsldap.sql 14-dec-2001.23:25:22 rbollu Exp $
    Rem
    Rem dbmsldap.sql
    Rem
    This is the output while running it (No errors):
    Library created.
    Package created.
    Package created.
    Package created.
    Package body created.
    Package body created.
    Package body created.
    Synonym created.
    Grant succeeded.
    Synonym created.
    Grant succeeded.
    Database is :
    compatible 9.2.0.0.0
    Am I missing something?
    I have searched all the forums and although there are many references to "Error Mapping Function", noone has reported it in the context of WF - LDAP Integration. So I am not sure how to proceed.
    Please help.
    thanks in advance,
    Libin

    Hi Libin,
    Can you please explain to me the parameters that you put in the Global Preferences, the LDAP_port,LDAP_user,and the others, because I don�t know where I need to search in the server this parameters and I don�t understand su much of OID.
    if you can give to me and little description of that parameters,this would thank for much.
    anticipated thanks
    Arlet

  • Call store procedure from pre-mapping

    Hi,
    I am currently working on OWB client version 10.2.0.4.36.My requirement is to call store procdure from pre-mapping tranformation.How to achieve this & how to pass parameters to the store procedure?
    Please let me know.
    Thanks,
    Siva

    Thanks for the quick reply.I am doing the same way as suggested.But am getting warning,when I validate it and is expecting to synchronize it.What warning you got exactly and i think you have not deployed the procedure.
    The reason for this procedure is to select max value from one of the table and then drop & recreate the sequence with max value + 1.
    Inside the procedure,am doing this all dynamically.which means am passing Columnname,tablename & sequencename to this procedure.
    Do you think is this good approach or any other advisable approach?Can you explain you requirement then only we can suggest the better way .
    Cheers
    Nawneet

  • Call Store Procedure in SQL Server

    How can I call an Oracle Store Procedure in a SQL Server procedure?

    Make sure you're calling the stored procedure with the same parameters at the same database. If that's not the case then send the procedure body and how you are calling it from code and DB .
    "If there's nothing wrong with me, maybe there's something wrong with the universe!"

  • How to call store procedure from an oci program

    Hello,
    I work on Oracle 8.1.7 under AIX.
    I must call from an OCI C++ program a store procedure that have an result set as param out.
    I'm not sure how can I call the procedure/function. I want to execute this statement and fetch the results.:
    " CALL Department.get_all (:1) " is this OK?
    " Call department.GetAll() into :1 "
    I have seen some example from an PL/SQL block but that's not ok for me.
    what i have done:
    i have created an package
    create or replace package department as
    type cursor_type is ref cursor;
    procedure get_emp( i_deptno in number, rs out cursor_type );
    procedure get_all( rs out cursor_type );
    function GetAll return cursor_type;
    end department;
    create or replace package body department as
    procedure get_emp ( i_deptno in number, rs out cursor_type )
    as
    begin
    open rs for
    select empno, ename
    from emp
    where deptno = i_deptno;
    end;
    procedure get_all ( rs out cursor_type )
    as
    begin
    open rs for
    select empno, ename
    from emp;
    end;
    function GetAll return cursor_type
    as
    l_cursor cursor_type;
    begin
    open l_cursor for select ename, empno from emp;
    return l_cursor;
    end;
    end;

    Hi,
    I am new to OCI facing the same problem you have mentioned, If you have found out how to solve it , can you post the answer for the same.
    Thanks
    Mani

  • Problem when call store procedure over a database link

    Hi all,
    I've create a database link in server "EAST" similar like:
    CREATE DATABASE LINK db_link CONNECT TO tiger IDENTIFIED BY scott USING 'abc';
    and from server "EAST" i ran the procedure located in server "WEST" somethin like:
    exec testing_procedure@db_link('test');
    testing_procedure is look like:
    Create or Replace procedure testing_procedure (p_testing in varchar2)
    as
    cursor check_space is
    select sum(bytes)/1024/1204 tb_size
    from dba_data_files;
    my_check_space%ROWTYPE;
    begin
    open check_space;
    loop
    fetch check_space into my_check_space;
    exit when check_space%NOTFOUND;
    insert into test_tf@db_link (test, tb_value) values
    (p_testing, my_check_space.tb_size);
    end loop;;
    close check_space;
    end;
    and my problem is when i'm run procedure from "EAST" server, the values in test_tf table is the same as when you run that procedure from "WEST" server. I've check the size for both server "EAST", and "WEST" by select sum(bytes)/1024/1204 command. And the value is completely different. And i guest somehow it reuse the value of "WEST" server no matter when you run that procedure in "EAST" server. Any suggesttion, please give me some advices.
    Thanks,
    Kevin

    If this procedure is in WEST server then even if you call it from some another planet using db link, the cursor inside the procedure will fetch the data from that server only means WEST server. So "select sum(bytes)/1024/1204 tb_size
    from dba_data_files;" statement in your procedure always fetch the size of the datafiles belongs to the WEST database.
    If you want to store the data of two different databases then you have to create the similar procedure in EAST database also.
    BTW, you said the you created a database link "db_link" in EAST database to point to WEST database and on WEST database you have that procedure BUT I don't understand why r u using "db_link" in your procdure code in WEST server in this insert statement:
    insert into test_tf@db_link (test, tb_value) values
    (p_testing, my_check_space.tb_size);Is there a database link on that box also?? Where it is pointing to?? And if not then this code should not be compiled.
    Daljit Singh

Maybe you are looking for