Call the PL/SQL procedure with in out parameter of OIC clob

Hello

For a few days, I am facing a problem. I have to call the pl/sql procedure with colb parameter out. I use c ++ and OIC (don't ask me why :)).

I use a pl/sql problem test procedure:

create or replace function Test (longField outside clob) return number is
Number of result;
Start
longField: = 'prefix ';
Result: = 12;
Return (result);
end Test;

So I do all the stuff with the connection to the DB,

I prepare the statement: "start: res: = test(:param); end; »
So I OCIHandleAlloc (m_pCtx-> hpEnv,
(void *) & m_hpStatement,.
OCI_HTYPE_STMT,
0,
(NULL);
and
OCIStmtPrepare (m_hpStatement,
m_pCtx-> hpErr,
(...),
(...),
OCI_NTV_SYNTAX,
OCI_DEFAULT);

Before the binding I prepare parameters. For a clob I devote to the lob Locator:

OCIDescriptorAlloc ((dvoid *) m_pCtx-> hpEnv, (dvoid *) & m_pLobLocator,)
(ub4) OCI_DTYPE_LOB (size_t) 0, (dvoid *) 0);
OCILobEnableBuffering (m_pCtx-> hpContext, m_pCtx-> hpErr, (OCILobLocator *) m_pLobLocator);

that I bind parameters using OCIBindByName and OCIStmtExecute statement execution.

I get an error
---------------------------
Microsoft Visual C++
---------------------------
Unhandled exception in... (ORAOCIEI11. (DLL): 0xC0000005: Access Violation.

My question is: is it possible to call the pl/sql procedure with parameter BEAK clob?
If Yes, what steps I need to do to succeed?

Thank you for your response.

Hello

Of course, it is possible :)

Show that you are your piece of code that is binding.
Are you sure you had correctly the lob descriptor in the call to bind?

Tags: Database

Similar Questions

  • Call the PL/SQL procedure with different parameters?

    I use PL/SQL for web development. I have a page of PL/SQL which collects information and returns the user off site with one return url (another PL/SQL procedure).

    I have the return procedure with every documented return variable (default null) in order to always take the return. However, there are (reported... cannot reproduce because of the nature of the business) cases where a 404 error is returned because of the incompatibility of parameter.

    Is it possible to proceed regardless of the parameters? Someone at - it suggestions?

    Thank you!

    user2960509 wrote:

    My problem is that they sometimes send back of settings that do not match what I expect.

    Use the interface "+ flexible +" mod_plsql - see the Oracle® HTTP Server mod_plsql user's Guide for the documented details.

    The signature of the procedure parameter is as follows (it is called by mod_plsql using tables of name value pairs):

    create or replace procedure Scott.MyWebProc( name_array owa.vc_arr, value_array owa.vc_arr) is
    ...
    

    In your code, you just browse the berries to get the name values passed query string. You can even filled an associative array in your code (a table indexed by string and no number, where the index string represents the name of param)-this approach can make it pretty easy for the code make reference to a parameter, with little effort on your part to provide an interface to query by name for code to get the value of a parameter name.

    To enable the flexible (aka parameter 2) call interface, precede the call to web with an exclamation character. For example

    http://my-webserbver.my-domain.com/pls/dad/!scott.mywebproc?name-1=val-1&name-2=val-2..,name-n=val=n
    
  • Wander, call from java to sql pl with table out parameter procedure

    Hello
    Please help me? It is urgent for me...
    My Oracle's Code is like this,

    CREATE TABLE TEST_TABLE ( DATE1 DATE, VALUE_EXAMPLE VARCHAR2(20 BYTE), VALUE2_EXAMPLE VARCHAR2(20 BYTE), VALUE3_EXAMPLE NUMBER ); CREATE OR REPLACE TYPE TONERECORDTEST AS OBJECT ( DATE1 DATE, VALUE_EXAMPLE VARCHAR2(20), VALUE2_EXAMPLE VARCHAR2(20), VALUE3_EXAMPLE NUMBER ); CREATE OR REPLACE TYPE TTESTTABLE IS TABLE OF TONERECORDTEST; CREATE OR REPLACE PACKAGE test_collection_procedures AS PROCEDURE testCallProcedureFromJava(start_time IN DATE, end_time IN DATE, table_data OUT TTesttable); END test_collection_procedures; / CREATE OR REPLACE PACKAGE BODY test_collection_procedures AS PROCEDURE testCallProcedureFromJava(start_time IN DATE, end_time IN DATE, table_data OUT TTesttable) IS BEGIN SELECT TONERECORDTEST(date1, value_example, value2_example, value3_example) BULK COLLECT INTO table_data FROM TEST_TABLE WHERE DATE1>=start_time AND DATE1<=end_time; END testCallProcedureFromJava; END test_collection_procedures;

    And it's like my Java Code

    import java.sql.Connection; import java.sql.DriverManager; import oracle.jdbc.OracleCallableStatement; import oracle.jdbc.OracleTypes; import oracle.sql.ARRAY; import oracle.sql.ArrayDescriptor; import oracle.sql.STRUCT; import oracle.sql.StructDescriptor; public class testPLCollectionType { public static void main(java.lang.String[] args) { try{ //Load the driver Class.forName ("oracle.jdbc.driver.OracleDriver"); // Connect to the database Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@serverbd:1521:squema1","user", "password"); // First, declare the Object arrays that will store the data (for TONERECORDTEST OBJECT TYPE) Object [] p2recobj; Object [] p3recobj; Object [] p4recobj; // Declare the Object Arrays to hold the STRUCTS (for TTESTTABLE TYPE) Object [] p2arrobj; // Declare two descriptors, one for the ARRAY TYPE // and one for the OBJECT TYPE. StructDescriptor desc1=StructDescriptor.createDescriptor("TONERECORDTEST",conn); ArrayDescriptor desc2=ArrayDescriptor.createDescriptor("TTESTTABLE",conn); // Set up the ARRAY object. ARRAY p2arr; // Declare the callable statement. // This must be of type OracleCallableStatement. OracleCallableStatement ocs = (OracleCallableStatement)conn.prepareCall("{call test_collection_procedures.testCallProcedureFromJa va(?,?,?)}"); // Declare IN parameters. Realize that are 2 DATE TYPE!!! Maybe your could change with setDATE ocs.setString(1,"01-JAN-04"); ocs.setString(2,"10-JAN-05"); // Register OUT parameter ocs.registerOutParameter(3,OracleTypes.ARRAY,"TTESTTABLE"); // Execute the procedure ocs.execute(); // Associate the returned arrays with the ARRAY objects. p2arr = ocs.getARRAY(3); // Get the data back into the data arrays. //p1arrobj = (Object [])p1arr.getArray(); p2arrobj = (Object [])p2arr.getArray(); System.out.println("Number of rows="+p2arrobj.length); System.out.println("Printing results..."); for (int i=0; i<p2arrobj.length; i++){ Object [] piarrobj = ((STRUCT)p2arrobj).getAttributes();
    System.out.println();
    System.out.print("Row "+i);
    for (int j=0; j<4; j++){
    System.out.print("|"+piarrobj[j]);
    }
    }

    }catch (Exception ex){
    System.out.println("Exception-->"+ex.getMessage());
    }
    }

    }
    Actually when i running the java program it is showing error
    Exception-->ORA-06550: line 1, column 58:
    PLS-00103: Encountered the symbol "VA" when expecting one of the following:

    := . ( @ % ;
    The symbol ":=" was substituted for "VA" to continue.
      I am not getting the error .Please help me out Dhabas Edited by: Dhabas on Jan 12, 2009 3:49 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    // Declare the callable statement.
    // This must be of type OracleCallableStatement.
    ..."{call test_collection_procedures.testCallProcedureFromJa va(?,?,?)}");
    

    Looks like divorced Ja's.

  • FND_REQUEST PL/SQL procedure with parameters

    Hi guys

    I created a concurrent program, using the PL/SQL procedure that has 2 parameters. I try to call the concurrent program to help

    v_req_id: = FND_REQUEST. SUBMIT_REQUEST ('INV', 'OMS_POP_INVVALUES_P',

    NULL, SYSDATE, FALSE, l_on_date, l_org_id,.

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL

    );

    COMMIT;

    However, the competitor programming always fail with

    * Starts * August 26, 2013 14:02:31 error ORACLE 6550 for Cause of FDPSTP: FDPSTP failed due to the ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in the call to 'OMS_POP_INVVALUES_P' ORA-06550: line 1, column 7: PL/SQL: statement ignored

    and I doubt that it is because the database procedure call is not correct.

    I put four parameters with the simultaneous program, as they were with the procedure itself, which are

    p_on_date BY DATE, NUMBER, errbuff OUT VARCHAR2, OUT VARCHAR2 retcode p_org_id

    Help, please

    Kind regards

    REDA

    Okay I solved the problem of

    1. change the order of the parameters in the procedure

    CREATE OR REPLACE PROCEDURE OMS_POP_INVVALUES_P)

    errbuff OUT VARCHAR2, retcode ON NUMBER, p_on_date AS, p_org_id in NUMBER)

    IS

    and by changing the call of simultaneous program as follows

    l_req_id: =.

    fnd_request.submit_request ('INV', 'OMS_POP_INVVALUES_P',

    NULL, SYSDATE, FALSE, l_in_date, l_org_id, CHR (0));

    : SYSTEM. Message_Level: = '25';

    COMMIT;

    After removing all the parameters of the list of program parameters. No need to pass a value for errbuff and retcode, just pass other parameters and put an end to the list of parameters with CHR (0). Hope it's useful for someone else there.

    Kind regards

    REDA

  • How to call the pl/sql function in application of the ADF

    Hi Experts,

    I need to call the pl/sql function in application of ADF, I have logic written in my AM

    Method:

    public String reportStoredProcedure (locationID customerID, number,
    String tailNum) {}

    CallableStatement st = null;
    String v_sanctioned = null;
    If (locationID! = null & & customerID! = null & & tailNum! = null) {}
    System.out.println (locationID + "" + customerID + "" + tailNum);
    Tail string = "TAIL";
    String result = "N";

    try {}
    String stmt =
    "start XXWFS_SANCTIONS_PKG. CHECK_SANCTION(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11); end; « ;
    St = getDBTransaction () .createCallableStatement (stmt, 0);
    st.setNull (1, Types.VARCHAR);
    st.setNull (2, Types.NUMERIC);
    st.setObject (3, customerID);
    st.setNull (4, Types.NUMERIC);
    st.setNull (5, Types.NUMERIC);
    st.setObject (6, locationID);
    st.setNull (7, Types.NUMERIC);
    st.setNull (8, Types.NUMERIC);
    st.setObject (9, tail);
    st.setObject (10, tailNum);
    st.setObject (11, result);
    St.Execute ();
    System.out.println ("v_sanctioned in AM:" + v_sanctioned);
    } catch (Exception e) {}
    e.printStackTrace ();
    return "N";
    } {Finally
    If (st! = null)
    try {}
    St.Close ();
    } catch (Exception e1) {}
    E1. PrintStackTrace();
    return "N";
    }
    }
    } else {}
    System.out.println ("v_sanctioned is null");
    v_sanctioned = "N";
    }
    Return v_sanctioned;
    }


    Error:

    java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'CHECK_SANCTION '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:191)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:950)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1224)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3858)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
    at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:99)
    at model.view.CardAMImpl.reportStoredProcedure(CardAMImpl.java:182)
    at com.emboss.bean.ReadyToPrint.invokeVSanctioned(ReadyToPrint.java:485)
    at com.emboss.bean.ReadyToPrint.PrintingCards(ReadyToPrint.java:434)
    at com.emboss.bean.ReadyToPrint.printCards(ReadyToPrint.java:204)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1259)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:97)
    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:90)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:94)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:91)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:94)
    at java.security.AccessController.doPrivileged (Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.doIt (WebAppServletContext.java:3684)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3650)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    Can someone help me how to call...

    Call it in function, not as a procedure you do

    try {
    String stmt =
    "begin :1 := XXWFS_SANCTIONS_PKG.CHECK_SANCTION(:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12); end;";
    st = getDBTransaction().createCallableStatement(stmt, 0);
    st.registerOutParameter(1, Types.VARCHAR);
    st.setNull(2, Types.VARCHAR);
    st.setNull(3, Types.NUMERIC);
    st.setObject(4, customerID);
    st.setNull(5, Types.NUMERIC);
    st.setNull(6, Types.NUMERIC);
    st.setObject(7, locationID);
    st.setNull(8, Types.NUMERIC);
    st.setNull(9, Types.NUMERIC);
    st.setObject(10, tail);
    st.setObject(11, tailNum);
    st.setObject(12, result);
    st.execute();
     = st.getString(1);
    
  • Cannot see the table in the p/sql procedure but can in normal sql

    Hello

    using 11.2.0.3

    that sql format

    Select schema_owner. < table > - it works in good sql and pl/sql get message table or view does not exist.

    Other fine tables.

    Y at - it a permission to have reference to the table in the pl/sql procedure rather than sql?

    Thank you

    Hello

    I'm glad you solved the problem!

    Don't forget to mark it as "answered".  It will help others with a similar problem, and it will save time for people answering questions on this forum.

  • How to call sql loader control file with in the pl/sql procedure

    Hi friends,

    I am doing a project in relation to the transfer data using queues. In the queue, I'll get a data delimited by tabs in the form of CLOB variable/message. I don't want to keep this dat in the oracle table.
    During the updating of the data in the table.

    1. don't want to write data to a file. (You want to access directly after the specific queue).

    2. as the data is in the form of delimited by tabs, I want to use sql loader concept.

    How can I call the ctrl charger sql file with in my pl/sql procedure. When I searched, most forums recommending the external procedure or a Java program.

    Please guide me on this issue. My preferrence is pl sql, but don't know the external procedure. If no other way, I'll try Java.

    I'm using oracle 9.2.0.8.0.

    Thanks in advance,
    Vimal...

    Or SQL * Loader, or external tables are designed to read data from a CLOB stored in the database. They both work on files stored on the file system. If you don't want the data to be written to a file, you have to roll your own parsing code. It is certainly possible. But it will be much less effective than SQL * Loader or external tables. And it is likely to lead to a little more code.

    The simplest possible thing that might work would be to use something like Tom Kyte string tokenization package to read a line in the CLOB, divide the component parts and save the different chips in a significant collection (i.e. an object type or a record type that matches the table definition). Of course, you need manage things like the conversion of strings to numbers or dates, rejecting the lines, writing to log files, etc.

    Justin

  • Need for a procedure with in, out, in the settings - small example.

    Hi Master,

    Need an little example with 3 parameters in a procedure. How to know call by value, by reference with out and inout parameters.

    create or replace procedure is sample (x number, are series, z in number)

    Start

    pass the value of x in y and z as well. and the 3 display values.   Code required...

    end;

    Many thanks in adv.

    AR


    Need an little example with 3 parameters in a procedure. How to know call by value, by reference with out and inout parameters.

    create or replace procedure is sample (x number, are series, z in number)

    Start

    pass the value of x in y and z as well. and the 3 display values.   Code required...

    end;

    Code required? This is NOT a coding service. This is a forum to help people with their questions on SQl, PL/SQL, or problems they have with the code THEY have written.

    See the doc of the PL/SQL language - he has examples of use of these three methods of parameter.

  • How to call the PL/SQL of EntityImpl procedure

    Hello

    I have a page that can create/update visitors. When a new customer is created themselves, a line gets inserted into the database table. I use EO for this feature.

    I need to create lines to two or three other table also when a new line is created in the main table. What is the best practice for this feature?

    The 2 options that I know:

    1 create a trigger on the main table and the appeal of trigger for inserting rows in other tables.

    2. call a PL/SQL of EntityImpl procedure after the permanent data is committed to the table. (If this is the best approach, could you please let me know how to get there)

    See you soon

    AJ

    In fact, Java Mail API is included in WLS and JDev, then you can simply add %MIDDLEWARE_HOME%\Oracle_Home\oracle_common\modules\javax.mail_2.0.0.0_1-4-4.jar to your project.

    Dario

  • The problem with ampersand in the PL/SQL procedure

    Dear Oracle experts,

    Please, help me to understand this case. I have the following code
    V_RESPONSE := UTL_HTTP.GET_RESPONSE (V_REQUEST);
    
          LOOP
             UTL_HTTP.READ_LINE (V_RESPONSE, V_BUFFER, FALSE);
             DATA_OUT := DATA_OUT || V_BUFFER;
          --DBMS_OUTPUT.PUT_LINE (V_BUFFER);
          END LOOP;
    And I'm getting DATA_OUT as
    <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns:chargeSubscriberResponse xmlns:ns="http://ws.cube.az"><ns:return>&lt;?xml version="1.0" encoding="UTF-8"?>
    &lt;response>
         &lt;retval>-2200003&lt;/retval>
         &lt;retmsg>Invalid Service&lt;/retmsg>
         &lt;quantity>&lt;/quantity>
         &lt;cube-transaction-id>&lt;/cube-transaction-id>
    &lt;/response></ns:return></ns:chargeSubscriberResponse></soapenv:Body></soapenv:Envelope>
    A don't have to '&' in this output. I need to analyze this variable to clear all ampersands. How can I do?

    Just replace does not work... I tried
    PROCEDURE Clean_up_xml (v_xml IN OUT VARCHAR2)
       IS
       BEGIN
          WHILE INSTR (v_xml, 'lt;') > 0
          LOOP
             v_xml :=
                SUBSTR (v_xml, 1, INSTR (v_xml, 'lt;') - 2)
                || SUBSTR (v_xml, INSTR (v_xml, 'lt;') + 4);
          END LOOP;
       END;
    But no luck...

    Does not erase the procedure '& '. How can I disable ampersand in PL/SQL procedure?

    Thanks in advance.

    PS: I know SET DEFINE OFF. But it only works in SQL * MORE.
    SQL> declare
      2
      3    data_out clob :=
      4  '<?xml version="1.0" encoding="UTF-8"?>
      5  <response>
      6       <retval>-2200003</retval>
      7       <retmsg>Invalid Service</retmsg>
      8       <quantity></quantity>
      9       <cube-transaction-id></cube-transaction-id>
     10  > </response>' ;
     11
     12  begin
     13
     14    for rec in (
     15        select r.*
     16        from xmltable(
     17               xmlnamespaces(
     18                 'http://www.w3.org/2003/05/soap-envelope' as "soap"
     19               , 'http://ws.cube.az' as "ns"
     20               )
     21             , '/soap:Envelope/soap:Body/ns:chargeSubscriberResponse'
     22               passing xmlparse(document data_out)
     23               columns xml_return clob path 'ns:return'
     24             ) x
     25           , xmltable('/response'
     26               passing xmlparse(document x.xml_return)
     27               columns retval              number       path 'retval'
     28                     , retmsg              varchar2(30) path 'retmsg'
     29                     , quantity            number       path 'quantity'
     30                     , cube_transaction_id varchar2(30) path 'cube-transaction-id'
     31             ) r
     32    )
     33    loop
     34
     35      dbms_output.put_line('retval = '||rec.retval);
     36      dbms_output.put_line('retmsg = '||rec.retmsg);
     37      dbms_output.put_line('quantity = '||rec.quantity);
     38      dbms_output.put_line('cube_transaction_id = '||rec.cube_transaction_id);
     39
     40    end loop ;
     41
     42  end;
     43  /
    
    retval = -2200003
    retmsg = Invalid Service
    quantity =
    cube_transaction_id = 
    
    PL/SQL procedure successfully completed
     
    
  • Need to call the PL/SQL Package in the group dynamics of approval class that implements IDynamicApprovalGroup

    Hi all

    This is regarding the approval of invoice AP I need in my project where the user selects the users/people approval when creating the invoice based on logic. There may be any number of users who could be part of the approval group.

    Approval users information is stored in a table with a single Bill.

    When the user initiates invoice approval, approval of the Bill should go to all the people/users selected in the invoice.

    I created the dynamic of approval group which is the result of a java class. This java class implements IDynamicApprovalGroup. (what is the oracle Developer Guide).

    I called PL/SQL to java class package to get all the details of users of custom for the current invoice table.

    I used the DriverManager.getConnection method by hard coding (JDBC URL, Username, Pwd) connection details that works perfectly fine.

    But I don't want to hard-code the connection details because it will change in bodies SIT/UAT/PROD.

    Please ask you to guide me if there is no solution for the information of connection without hard coding it.

    Following code used to get the connection details

    try {}

    Class.forName ("oracle.jdbc.driver.OracleDriver");

    System.out.println ("= class loaded");

    }

    catch (ClassNotFoundException ex) {}

    System.out.println ("= class loading error");

    ex.printStackTrace ();

    }

    Fitting out = null;

    CallableStatement cstmt = null;

    Try

    {

    connection = DriverManager.getConnection ("jdbc:oracle:thin:@xxhostname:1521/SID", "FUSION", "*");

    Connection = GetConnection ();

    System.out.println ("= connection =" + connection);

    prepare the call

    cstmt = connection.prepareCall ("{call XX_AP_INV_DYN_APPROVAL_PKG. {GET_GROUP_PARTICIPANTS (?,?)} ») ;

    cstmt.setString (1, '12345');   ID on invoice

    Exit of the register

    cstmt.registerOutParameter (2, java.sql.Types.VARCHAR);

    Call the stored procedure

    cstmt. Execute();

    System.out.println ("= procedure being executed");

    approvalGroupMembers = cstmt.getString (2).split("#");

    System.out.println ("= output:" + cstmt.getString (2));

    }

    catch (Exception ex) {}

    ex.printStackTrace ();

    }

    Finally

    {

    Try

    {

    If (cstmt! = null)

    close the callable statement

    {

    cstmt. Close();

    cstmt = null;

    }

    System.out.println ("= stmt closed");

    }

    catch (SQLException ex)

    {

    System.out.println ("= stmt close err");

    ex.printStackTrace ();

    }

    Try

    {

    If (connection! = null)

    close the connection

    {

    Connection.Close;

    connection = null;

    }

    System.out.println ("= closed conn");

    }

    catch (SQLException ex)

    {

    System.out.println ("= Close conn err");

    ex.printStackTrace ();

    }

    }

    Thank you

    Dipak.

    HI Dembélé - you should be able to call the provider database from the java class. Documentation is here. However, you need to specify the name of the data provider that is the same in all environments. Do you know what it is? If it's not I'll take a look and get back to you.

    __

    Peter Maurer

    Relationship with the developers of Applications in fusion

    https://blogs.Oracle.com/fadevrel/

  • Call the PL/SQL shell script

    Hi all

    I've seen several links and options for calling a PL/SQL shell script. I was wondering if there is something like DBMS_SCHEDULER. CREATE_PROGRAM-> executable that calls an external program in 11 GR 2.

    Here's what I have to. I have 11 GR 2 database with Dataguard. I have START triggering who begins a DBMS_SERVICE when the role becomes PRIMARY. In the same instance, I would stop the VIP on the former primary database and start the VIP on the new primary database.

    Thanks for the advice and assistance.

    Jan S.

    The URL below links to ask Tom. Inside, he talks about creating a Java procedure in your database that allows you to execute commands from the host OS (PL/SQL calls the proc of Java that runs the host command). There are several ways to run the OS commands, but this one is very flexible. I needed to use it for a task that I have who didn't fit one of the other methods very well.

    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:no:P11_QUESTION_ID:3069633370832

  • Call the file sql plsql

    Hello
    I'm stuck for several days in this issue. Hope someone help me.

    I'm using Oracle 11.

    I am writing a utility to purge the data from the database based on certain criteria.
    We do not have physical (actual) the partitions present on our system (since we do not use Enterprise edition).
    We have 57 paintings representing 57 partitions. Then, we create a view of all of these 57 tables-

    CREATE or REPLACE VIEW MY_VIEW AS
    Select [column_names] from table1
    UNION ALL
    Select [column_names] in table2
    UNION ALL
    Select [column_names] in table 3
    UNION ALL
    :
    :
    :
    Select [column_names] of table57
    ;

    This superior query is saved in the 'body' of user_views.

    Now when a user wants to delete a partition-
    -I read the body of the request in the .sql file.
    -Edit the .sql file that is, remove the unwanted ' select * from many '
    -Loss of vision.
    -Recreate the view from the edited .sql file.


    The question is in the creation of the view on the fly of the procedure-
    -I'm not EXECUTE IMMEDIATE 'CREATE VIEW... ' and ' DBMS_SQL. PARSE' the request body exceeds 32,767 characters.


    So I chose the option of filing to write. In the file, I write the query VIEW and then I want to create the view from this file.

    Now, I'm not able to call the .sql that contains
    CREATE OR REPLACE VIEW MYVIEW AS
    Select...
    UNION ALL
    Select...
    :
    :
    Select...

    Length of character of this file is about 90000.



    Please guide me in this issue.
    Any new idea to manage very large display in the long term is also welcome...


    Thanks in advance
    Micheline
    ARGE view at run time is also welcome...


    Thanks in advance
    Micheline

    When you use DBMS_SQL, the declaration must not end with a semicolon, or you will get ora - 911.

    ---------
    Sybrand Bakker
    Senior Oracle DBA

  • How do I call the interactive report procedure?

    Hello
    Is possible that call the procedure in an interactive report on the APEX?
    Because
    in the source of the region, he asked only the sql statement so I'm confused and I don't know how to call procedure interactive report?

    Published by: esra aktas on 12.May.2011 11:04

    Published by: esra aktas on 12.May.2011 12:05

    And your procedure returns the data? Why you don't run in an area of pl/sql?

    Or better yet, a page with two 2 areas of installation

    Region one is of html with your controls to display, and then select the procedure to run from a selection list. When your selection list returns and have a running process that takes this value, select the code you want on your table and he published on a page element.

    second region would be a region of sql report, which uses a function returns sql to select necessary sql, using the code met at step 1...

    Thank you

    Tony Miller
    Webster, TX

    On the road of life... He has "windshield", and there are "bugs".
    (splat!)
    "Squeegees wanted."

    If you answer this question, please mark the thread as closed and give points where won...

  • Need to check delays in update of 1000 lines using the PL/SQL procedure.

    Hi all

    I'm new to PL/SQL. I need your help to build a procedure that executes the following statement and follows the time of update of 1000 rows. This is to check the performance of the database. I need to print the timestamp of start before the update and end timestamp after update. I need to do for the 1000 lines. The statement that will be used in the procedure is:

    SELECT

    'UPDATE XXAFL_MON_FACTS_F SET TASK_WID =' | NVL (TO_CHAR (TASK_WID), 'NULL') |', EXECUTION_PLAN_WID =' | NVL (TO_CHAR (EXECUTION_PLAN_WID), 'NULL').

    ', DETAILS_WID =' | NVL (TO_CHAR (DETAILS_WID), 'NULL') |', SOURCE_WID =' | NVL (TO_CHAR (SOURCE_WID), 'NULL') |', TARGET_WID = ' | NVL (TO_CHAR (TARGET_WID), 'NULL').

    ', RUN_STATUS_WID =' | NVL (TO_CHAR (RUN_STATUS_WID), 'NULL') |', SEQ_NUM =' | NVL (TO_CHAR (SEQ_NUM), 'NULL') |', NAME = "' | NVL (TO_CHAR (NAME), 'NULL').

    "', NO_POSITION =" ' | NVL (TO_CHAR (INSTANCE_NUM), e ') | " ', INSTANCE_NAME = "' | NVL (TO_CHAR (INSTANCE_NAME), 'NULL').

    "', TYPE_CD =" ' | NVL (TO_CHAR (TYPE_CD), e ') | " ', STATUS_CD = "' | NVL (TO_CHAR (STATUS_CD), e ') | " ', START_TS =' | NVL (TO_CHAR (START_TS), 'NULL').

    ', END_TS =' | NVL (TO_CHAR (END_TS), 'NULL') |', DURATION = ' | NVL (TO_CHAR (DURATION), 'NULL') |', STATUS_DESC = "' | NVL (TO_CHAR (STATUS_DESC), 'NULL').

    "', DBCONN_NAME =" ' | NVL (TO_CHAR (DBCONN_NAME), e ') | " ', SUCESS_ROWS =' | NVL (TO_CHAR (SUCESS_ROWS), 'NULL').

    ', FAILED_ROWS =' | NVL (TO_CHAR (FAILED_ROWS), 'NULL') |', ERROR_CODE = ' | NVL (TO_CHAR (ERROR_CODE), 'NULL') |', NUM_RETRIES =' | NVL (TO_CHAR (NUM_RETRIES), 'NULL').

    ', READ_THRUPUT =' | NVL (TO_CHAR (READ_THRUPUT), 'NULL') |', LAST_UPD = ' | NVL (TO_CHAR (LAST_UPD), 'NULL') |', RUN_STEP_WID = "' | NVL (TO_CHAR (RUN_STEP_WID), 'NULL').

    "', W_INSERT_DT = ' | NVL (TO_CHAR (W_INSERT_DT), 'NULL') |', W_UPDATE_DT = ' | NVL (TO_CHAR (W_UPDATE_DT), 'NULL').

    ', START_DATE_WID =' | NVL (TO_CHAR (START_DATE_WID), 'NULL') |', END_DATE_WID = ' | NVL (TO_CHAR (END_DATE_WID), 'NULL') |', START_TIME =' |

    NVL (TO_CHAR (START_TIME), 'NULL') |', END_TIME =' | NVL (TO_CHAR (END_TIME), 'NULL'). "WHERE INTEGRATION_ID ="' | INTEGRATION_ID | " « ; »  OF XXAFL_MON_FACTS_F;

    The above query creates instructions of update that must be executed 1000 times and the time required to update the 1000 lines should be followed.

    Thanks in advance!

    Code horribly wrong!

    Why this approach?

    Dynamic SQL is almost NEVER needed in PL/SQL. And if you think it's necessary and taking into account what is displayed as being problems here, you have a 99% chance of being wrong.

    This 1% where dynamic SQL is necessary, he will WITH bind variables to create shareable SQL, decrease memory requests, decrease the likelihood of a fragmented shared reel and decrease the burning CPU cycles on hard analysis.

    An example below. Your approach is the 1st. One that is slower than the correct approach to 37 (x_!) ...

    SQL> create table t ( n number );
    
    Table created.
    
    SQL>
    SQL> var ITERATIONS number;
    SQL> exec :ITERATIONS := 100000;
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL>
    SQL> TIMING START "INSERTs using Hard Parsing"
    SQL> declare
      2          i      integer;
      3  begin
      4          for i in 1..:ITERATIONS
      5          loop
      6                  execute immediate 'insert into t values ('||i||')';
      7          end loop;
      8          commit;
      9  end;
    10  /
    
    PL/SQL procedure successfully completed.
    
    SQL> TIMING SHOW
    timing for: INSERTs using Hard Parsing
    Elapsed: 00:02:00.33
    SQL>
    SQL> TIMING START "INSERTs using Soft Parsing"
    SQL> declare
      2          i      integer;
      3  begin
      4          for i in 1..:ITERATIONS
      5          loop
      6                  execute immediate 'insert into t values ( :1 )' using i;
      7          end loop;
      8          commit;
      9  end;
    10  /
    
    PL/SQL procedure successfully completed.
    
    SQL> TIMING SHOW
    timing for: INSERTs using Soft Parsing
    Elapsed: 00:00:06.06
    SQL> drop table t;
    
    Table dropped.
    
    SQL> create table t( n number );
    
    Table created.
    
    SQL>
    SQL>
    SQL> TIMING START "INSERTs using a single parse and repeatable statement handle "
    SQL> declare
      2          i      integer;
      3  begin
      4          for i in 1..:ITERATIONS
      5          loop
      6                  insert into t values ( i );
      7          end loop;
      8          commit;
      9  end;
    10  /
    
    PL/SQL procedure successfully completed.
    
    SQL> TIMING SHOW
    timing for: INSERTs using a single parse and repeatable statement handle
    Elapsed: 00:00:04.81
    SQL>
    

Maybe you are looking for

  • The money disappeared after I added a new iTunes gift card.

    I know FOR A FACT that I had $3.55 in my iTunes account, and when I added a $15 card it said my balance was only $15!  It's happened, but I thought I had exhausted my money and not noticed, but now that it's happened again I'm sure that something wil

  • Accidentally deleted partition recovery on Satellite C855

    While trying to recover my laptop that I seem to have done the opposite and remove disk hard whole, including the recovery partition hidden it called, I used the Toshiba maintenance tool thinking the removal was simply a process of formatting and win

  • Satellite A-L50-19N WiFi disconnection problem

    Yesterday I bought this computer with Windows 8.1 installed. After each start, is to have the connection for a few minutes, then it always disconnects. It shows that the internet connection is active, but are not open pages in a browser. I tried upda

  • Satellite U300 - sound card disappeared

    Hello. Since this morning, that the sound card on my laptop is missing, for example, linux and windows xp can't find it and I can not hear or read any sound. I have installed new software on those OSs and I've only used Notepad to run a linux live-cd

  • Pavilion 15 r014tx: WiFi problem...

    Mr PresidentI had a problem with the WiFi IE my laptop connects with my wifi (router), then I called your customer care free of charge and recorded in 3 cases already, IE 1 case Id-4777828830 23/09/2016, 2nd case Id-4777960893 on 27/09/2016 and 3rd c