Usage of Stored Procedure - BO3.1 SP3

How to use Stored procedure for creating Universe Objects in BO 3.1 SP3?

Hi Christian,
Thanks for your reply.
I think the best thing you can do to reproduce it is replacing the
select pp_tws_seq.nextval
into l_tws_id
from dual
return l_tws_id;
with a simple "return 1;" statement in the function definition and create this package in the database.
By dragging and dropping the function and the procedure within the package in the dataset designer you can reproduce my findings.
The code I've given you is a part of the code generated by the Oracle Developer Tools!. The complete code is quite lengthy, so I didn't include it.
Regards,
Matthieu

Similar Messages

  • Urgent: XSQLRequest Usage in Stored procedure

    Hi Steve,
    I have developed a java stored procedure and published it as required to be called from a trigger.My java code uses XSQLRequest to read the .xsql page.
    Earlier i was not able to resolve the java code which i had written but some how i finally was able to resolve the code and publish as stored procedure.
    when i run my stored procedure it writes output to the file as intended but it reads as follows:
    Oracle XSQL Programmatic Page Processor 0.9.8.6 (Technology Preview)
    XSQL-003: Failed to find 'XSQLConnections.xml' file in server CLASSPATH.
    XSQL-004: Could not acquire a database connection named: pnet
    XSQL-007: Cannot acquire a database connection to process page.
    since the stored procedure runs inside the oracle server and all the java classes are inside the oracle server i'm unable to comprehend this error.
    it says to have the XSQLConnections.xml file in my classpath but what do i do to change the classpath and which one since i'm running the code inside the oracle server how do i specify the classpath?
    sorry if this sound silly but i'm confused and may be u can help me with this.
    Thanks
    Aman

    loadjava -u username/password XSQLConfig.xml
    this will load the xml file as a resource
    into your server classpath.

  • Usage of Varray in a Stored Procedure Executed through OCIStmtExecute

    Hi,
    I'm new to OCI Programming. My requirement is to pass an array to a Stored Procedure.
    In Stored Procedure this input variable is of type VARRAY.
    I'm following the approach given below.
    OCITypeByName()
    OCIObjectNew()
    OCICollAppend()
    OCIBindByPos()
    OCIBindByObject()
    OCIStmtExecute()
    I encounter an error in OCITypeByName (this function call fails)
    Can anyone provide me some sample codes
    Also pls provide information if there is a better approach to be followed in this regard.
    Thanks,
    Alamelu
    null

    Hi Alamelu,
    Make sure you created the type correctly in the database using SQL DDL.
    You can verify that from sqlplus
    sqlplus username/password
    describe typename;
    Here is a code snippet :-
    #define SCHEMA "TKP8ADT1"
    OCITypeByName(envhpx, errhp, svchpx, (const text *) SCHEMA,
    (ub4) strlen((char *)SCHEMA), (const text *) "ADDRESS_VALUE",
    (ub4) strlen((char *)"ADDRESS_VALUE"), (CONST text *) 0,
    (ub4) 0, OCI_DURATION_SESSION, OCI_TYPEGET_HEADER, &addr_tdo);
    thanks,
    Ravi

  • Problem with stored procedure usage when Toplink api is used

    In one of our applications we used the combination of JBoss4.0.2 application server, Oracle Toplink 10g (9.0.4.5), JDBC Driver Version is ..... 10.1.0.2.0, Database Product Version is Oracle9i Enterprise Edition Release 9.2.0.6.0, j2sdk1.4.2_08
    We faced problem in the application when it is trying to call stored procedure using Oracle Toplink api
    code snippet:
    public ByteArrayOutputStream baos = new ByteArrayOutputStream();
    public PrintStream pos = new PrintStream(baos);
    public String delete(String Id)
    String procedureName = "abc";
    try
    UnitOfWork uow = PersistenceManager.getCurrent().getUnitOfWork();
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName(procedureName);
    call.addUnamedArgumentValue(Id);
    uow.executeNonSelectingCall(call);
    uow.commit();
    catch (Exception e)
    message = e;
    e.printStackTrace(pos);
    message = message+ baos.toString();
    return message;
    Stack Trace:
    Exception [TOPLINK-4002] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.DatabaseException Exception Description: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier 'abc' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier 'abc' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored Error Code: 6550Local Exception Stack: Exception [TOPLINK-4002] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.DatabaseException Exception Description: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier 'abc' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier 'DELETE_LOADED_RESULT_SET' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored Error Code: 6550 at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:227) at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:733) at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:781) at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:642) at oracle.toplink.publicinterface.UnitOfWork.executeCall(UnitOfWork.java:1400) at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:131) at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:115) at oracle.toplink.internal.queryframework.CallQueryMechanism.executeNoSelectCall(CallQueryMechanism.java:164) at oracle.toplink.internal.queryframework.CallQueryMechanism.executeNoSelect(CallQueryMechanism.java:143) at oracle.toplink.queryframework.DataModifyQuery.execute(DataModifyQuery.java:41) at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:493) at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:1958) at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2236) at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1086) at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1038) at oracle.toplink.publicinterface.Session.executeNonSelectingCall(Session.java:816) at com.abc.de.fg.model.resultSet.ResultSetProvider.delete(ResultSetProvider.java:150) at
    Could anyone please let me know what might be the problem in this case.

    Tried and couldn't reproduce the problem using 9.0.4.7.
    Here's the code:
        System.out.println("storedProcedureUnamedValueTest");
        StoredProcedureCall call = new StoredProcedureCall();
        String lastName = "Jones";
        call.setProcedureName("STOREDPROCEDURE_IN");
        call.addUnamedArgumentValue(lastName);
        session.executeNonSelectingCall(call);stored procedure definition in data base:
    CREATE OR REPLACE  PROCEDURE "TEST_904"."STOREDPROCEDURE_IN"  (
         IN_PARAM VARCHAR2) AS
    BEGIN
      UPDATE EMPLOYEE SET F_NAME = 'Indiana' WHERE (L_NAME = IN_PARAM);
    END;log:
    storedProcedureUnamedValueTest
    DatabaseSession(15)--Execute query DataModifyQuery()
    DatabaseSession(15)--Connection(16)--BEGIN STOREDPROCEDURE_IN('Jones'); END;
    DatabaseSession(15)--Connection(16)--reconnecting to external connection poolAndrei

  • Unable to use the values returned by a PL/SQL stored procedure in a XSQL page

    Hi,
    I've been messing around with XML and XSQL in particular. I was trying to write a xsql page to display a report with account totals...I have the following .xsql which calls a PL/SQL stored procedure :
    <?xml version="1.0"?>
    <xsql:query connection="pfcdm" xmlns:xsql="urn:oracle-xsql">
    <xsql:set-session-param name="zasset_total" value="100">
    <xsql:dml connection="pfcdm">
    rraman.sp_vw_id(zasset_total,zinvm_total,zmkt_val);
    </xsql:dml>
    </xsql:set-session-param>
    select 'Asset total is {@zasset_total}' as "ASSET_TOTAL" from dual
    </xsql:query>
    My procedure sp_vw_id returns the values that it should. But, I am not sure how to declare variables within a page, and to output the return values. There is very scanty documentation on the usage of <xsql:dml> or <xsql:ref-cursor-function>.
    Any response would be greatly appreciated.
    Thanks,
    Raja

    Here is the example from the Oracle9i (complete rewrite) of the XSQL Chapter in our Oracle documentation.
    Question
    I using <xsql:dml> to call a stored procedure which has one OUT parameter, but I was not able to see any results. The executed code results in the following statement:
    <xsql-status action="xsql:dml" rows="0"/>
    Answer
    You cannot set parameter values by binding them in the position of OUT variables in this release using <xsql:dml>. Only IN parameters are supported for binding. You can create a wrapper procedure that constructs XML elements using the HTP package and then your XSQL page can invoke the wrapper procedure using <xsql:include-owa> instead.
    For an example, suppose you had the following procedure:
    CREATE OR REPLACE PROCEDURE addmult(arg1 NUMBER,
    arg2 NUMBER,
    sumval OUT NUMBER,
    prodval OUT NUMBER) IS
    BEGIN
    sumval := arg1 + arg2;
    prodval := arg1 * arg2;
    END;You could write the following procedure to "wrap" it, taking all of the IN arguments that the procedure above expects, and then "encoding" the OUT values as a little XML datagram that you print to the OWA page buffer:
    CREATE OR REPLACE PROCEDURE addmultwrapper(arg1 NUMBER, arg2 NUMBER) IS
    sumval NUMBER;
    prodval NUMBER;
    xml VARCHAR2(2000);
    BEGIN
    -- Call the procedure with OUT values
    addmult(arg1,arg2,sumval,prodval);
    -- Then produce XML that encodes the OUT values
    xml := '<addmult>'&#0124; &#0124;
    '<sum>'&#0124; &#0124;sumval&#0124; &#0124;'</sum>'&#0124; &#0124;
    '<product>'&#0124; &#0124;prodval&#0124; &#0124;'</product>'&#0124; &#0124;
    '</addmult>';
    -- Print the XML result to the OWA page buffer for return
    HTP.P(xml);
    END;This way, you can build an XSQL page like this that calls the wrapper procedure:
    <page connection="demo" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-owa bind-params="arg1 arg2">
    BEGIN addmultwrapper(?,?); END;
    </xsql:include-owa>
    </page>This allows a request like:
    http://yourserver.com/addmult.xsql?arg1=30&arg2=45
    to return an XML datagram that reflects the OUT values like this:
    <page> <addmult><sum>75</sum><product>1350</product></addmult>
    </page>

  • How do I modify a report to show new fields in a stored procedure?

    The server uses Crystal Reports Embedded Server 2008 SP3 (running on Windows Server 2008 R2 / IIS 7.5), and I am using Crystal Reports Developer 2008 SP3 on my PC.
    Hello,
    I am a MSSQL database administrator with little experience with Crystal Reports.  At my job, we have a need to add a couple of fields to a report.  The report comes with an enterprise procurement web-based application and displays the details of a given purchase order.  They want me to add the supplieru2019s address below the supplieru2019s name on the report.  I was hoping there might be a fairly straight-forward, not overly complicated answer to my question.
    The report works with a stored procedure (OrderForm1) which creates a temp table called #ReportParameters.  It then executes another stored procedure (GetReportParameters), in which it uses 'sp_xml_preparedocument' and eventually 'sp_xml_removedocument'.  It then executes a stored procedure called  (OrderForm1Main) which contains the select statement that brings in the bulk of the fields and joining the pertinent tables.  I made a backup copy of OrderForm1Main and modified the original, to include the supplier address fields.
    Don't know if I'm on the right track, but hereu2019s what I tried so far:
    When I open the OrderForm1.rpt in Crystal Designer, I have found that I can go to Database > Set Datasource Location, create a connection (OLE DB (ADO)) to the database, highlight the name of the stored procedure under u2018Current Data Sourceu2019, then find the same stored procedure in the database in the section u2018Replace withu2019:
    http://i.imgur.com/KXBuf.png
    When I clicked the u2018Updateu2019 button, a u2018Enter Valuesu2019 for parameters window pops up:
    http://i.imgur.com/5uQ9V.png
    Iu2019m confused as to what to do at this part.  Whether I click u2018OKu2019 or u2018Cancelu2019, it then adds my database connection with stored procedure to the list in the u2018Current Data Sourceu2019 section:
    http://i.imgur.com/aD4KH.png
    After completing this data source change, in the Field Explorer under Database Fields > OrderForm1, it then includes the new fields I added to the stored procedure.  However, when dragging the new supplier address fields to the report layout, saving the report in this state, and trying to run it in the web application, the report window displays the message u2018Missing parameter valuesu2019 instead of the report:
    http://i.imgur.com/gz8S3.png
    In Field Explorer > Database Fields > Parameters, Iu2019m seeing a list of parameters that arenu2019t the exact ones in the stored procedure, which leads me to believe, they are somehow defined in the report itself.  Also, under u2018Parameter Fieldsu2019 in the Fields Explorer there is the @fParameters listing with a question mark icon, that appeared since the data source change:
    http://i.imgur.com/llkrk.png
    There does not seem to be an equivalent set of parameters in the database, as there were defined in the report.  I imagine that the actual parameter values come from the data held in the currently displayed purchase order (from which you can push a button 'Print PO' that will display the report in question).  I have read that when you change a data source in Crystal, you have to complete the task of resetting, or adding back in the parameters.  That would be easy if they were in the database somewhere.  Whenever I attempt to look at the properties of the u2018ReportInformationu2019 in u2018Set Datasource Locationu2019, or simply try Database > 'Verify Database' to refresh the datasource, an u2018ADO.NET (XML) windows pops up with a file path in it, something to the effect of:
    MyLoanerLaptop\ebo bk\orderform1.xml:
    http://i.imgur.com/SEVOE.png
    I did a search on the entire server for the file OrderForm1.XML and could not find it anywhere.  So Iu2019m thinking that the software companyu2019s development team used that file originally, to create the report (did they use a dataset to do this, or is the temporary XML file created during the process actually the schema here?).  I think Iu2019m basically trying to change the data source in the report, to an updated version of the original stored procedure referenced, while still somehow leaving the parameters list in the report alone and have them still work?
    Any and all help would be greatly appreciated.  I realize that this type of work most likely is routine stuff that can be learned by taking the time to do so.  My team is only interested in allowing me a certain amount of time and resources to delve into Crystal and we do not have a Crystal dev team.  So, hopefully you understand my dilemma here.
    Thank you,
    Mike
    Edited by: Mike_DBA on Jan 23, 2012 8:03 PM
    Edited by: Mike_DBA on Jan 23, 2012 8:05 PM
    Edited by: Mike_DBA on Jan 23, 2012 8:11 PM (2:12 pm EST)
    Edited by: Mike_DBA on Jan 23, 2012 8:13 PM
    Edited by: Mike_DBA on Jan 23, 2012 8:18 PM
    Edited by: Mike_DBA on Jan 23, 2012 8:30 PM
    Edited by: Mike_DBA on Jan 23, 2012 10:58 PM

    Hi Mike,
    CRSE is an OEM Product and for use with a custom application they have written. Unfortunately we don't their reports or how they are connecting, it would appear they were originally built off a SQL and then set to a Dataset in the app or they could be adding the data source at runtime. Lots of variations and without access to the source code to see what they are doing not much we can help you with.
    You need to contact the OEM Partner for help in resolving this and find out what you can and need to do to update your SP and work with their canned reports,
    Thank you
    Don

  • Passing Comma separated input to stored procedure in IN clause

    Hi All,
    I have a query below in a stored procedure as like this
    Create PROCEDURE insertinfo
    @userids varchar(MAX)
    AS
    BEGIN
    INSERT INTO records
    (id
    ,name
    ,address1
    ,address2
    ,pincode
    SELECT
    id,
    name,
    addr1,
    addr2,
    pin,
    FROM userinfo
    WHERE userinfo.id in(@userids)
    END
    I am not using any dynamic sql. Its a simple insert into select query with multiple parameters supplied via thd @userids parameter. When i  run the query nothing is inserting in the "records" table. I have gone throught the web search have
    tried with few options but no result yet. The query works fine when i pass only a single value, but it does not work when is pass multiple values.
    Please guide on this.
    Your help is appreciated.
    Thanks,
    mds2907

    mds2907,
    CHeck this:
    --Method 1
    --Usage of TVP
    --Method 2
    --Usage of SPLIT fn()
    Create PROCEDURE insertinfo(@userids varchar(MAX))
    AS
    BEGIN
    INSERT INTO records
    (id,name,address1,address2,pincode)
    SELECT id, name,addr1,addr2, pin
    FROM userinfo
    WHERE userinfo.id in(select * from sample_split(@userids,','))
    END
    --Method3
    --Usage of Dynamic SQL
    Applicable only when the values in csv are integers
    like '1,2,3'
    Create PROCEDURE insertinfo(@userids varchar(MAX))
    AS
    BEGIN
    DECLARE @sql nvarchar(max)
    SET @sql='
    INSERT INTO records
    (id,name,address1,address2,pincode)
    SELECT id, name,addr1,addr2, pin
    FROM userinfo
    WHERE userinfo.id in('+@userids')'
    EXEC sp_executesql @sql
    END
    Sample_Split():
    CREATE FUNCTION dbo.sample_Split
    @RowData nvarchar(2000),
    @SplitOn nvarchar(5)
    RETURNS @RtnValue table
    Id int identity(1,1),
    Data nvarchar(100)
    AS
    BEGIN
    Declare @Cnt int
    Set @Cnt = 1
    While (Charindex(@SplitOn,@RowData)>0)
    Begin
    Insert Into @RtnValue (data)
    Select
    Data = ltrim(rtrim(Substring(@RowData,1,Charindex(@SplitOn,@RowData)-1)))
    Set @RowData = Substring(@RowData,Charindex(@SplitOn,@RowData)+1,len(@RowData))
    Set @Cnt = @Cnt + 1
    End
    Insert Into @RtnValue (data)
    Select Data = ltrim(rtrim(@RowData))
    Return
    END
    Usage of TVP for a scenario similar to yours is explained herE:
    http://blog.sqlauthority.com/2008/08/31/sql-server-table-valued-parameters-in-sql-server-2008/
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/0ead7ceb-3fdd-4625-aa82-1d4195f984b1/passing-multivalue-parameter-in-stored-procedure-ssrs
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Calling a Stored Procedure with output parameters from Query Templates

    This is same problem which Shalaka Khandekar logged earlier. This new thread gives the complete description about our problem. Please go through this problem and suggest us a feasible solution.
    We encountered a problem while calling a stored procedure from MII Query Template as follows-
    1. Stored Procedure is defined in a package. Procedure takes the below inputs and outputs.
    a) Input1 - CLOB
    b) Input2 - CLOB
    c) Input3 - CLOB
    d) Output1 - CLOB
    e) Output2 - CLOB
    f) Output3 - Varchar2
    2. There are two ways to get the output back.
    a) Using a Stored Procedure by declaring necessary OUT parameters.
    b) Using a Function which returns a single value.
    3. Consider we are using method 2-a. To call a Stored Procedure with OUT parameters from the Query Template we need to declare variables of
    corresponding types and pass them to the Stored Procedure along with the necessary input parameters.
    4. This method is not a solution to get output because we cannot declare variables of some type(CLOB, Varchar2) in Query Template.
    5. Even though we are successful (step 4) in declaring the OUT variables in Query Template and passed it successfully to the procedure, but our procedure contains outputs which are of type CLOB. It means we are going to get data which is more than VARCHAR2 length which query template cannot return(Limit is 32767
    characters)
    6. So the method 2-a is ruled out.
    7. Now consider method 2-b. Function returns only one value, but we have 3 different OUT values. Assume that we have appended them using a separator. This value is going to be more than 32767 characters which is again a problem with the query template(refer to point 5). So option 2-b is also ruled out.
    Apart from above mentioned methods there is a work around. It is to create a temporary table in the database with above 3 OUT parameters along with a session specific column. We insert the output which we got from the procedure to the temporary table and use it further. As soon the usage of the data is completed we delete the current session specific data. So indirectly we call the table as a Session Table. This solution increases unnecessary load on the database.
    Thanks in Advance.
    Rajesh

    Rajesh,
    please check if this following proposal could serve you.
    Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
    Here is an example how this could be defined.
    Package:
    type return_cur IS ref CURSOR;
    Procedure:
    PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
    OPEN myReturnCur FOR SELECT val1, val2, val3  FROM dual;
    Query:
    DECLARE
      MYRETURNCUR myPackage.return_cur;
    BEGIN
      myPackage.myProc(
        MYRETURNCUR => ?
    END;
    Good luck.
    Michael

  • Stored procedure in a transaction problem

    hello to everybody
    I have an application under weblogic8.1 sp3.
    I have to call an Oracle stored procedure that populate a table and I have to see the new record anly at the end of the ejb service transaction ( a Container transaction ).When the procedure terminate I see the db data before the transaction end.So I have created a XA DataSource and changed the oracle 9.2 thin drivers in oracle 9.2 thin drivers XA.But Now I receive this Oracle Error:
    ORA-02089: COMMIT is not allowed in a subordinate session
    Why?How Can I resolve my problem?Can Anyone Help Me?Thanks...

    giorgio giustiniani wrote:
    hello to everybody
    I have an application under weblogic8.1 sp3.
    I have to call an Oracle stored procedure that populate a table and I have to see the new record anly at the end of the ejb service transaction ( a Container transaction ).When the procedure terminate I see the db data before the transaction end.So I have created a XA DataSource and changed the oracle 9.2 thin drivers in oracle 9.2 thin drivers XA.But Now I receive this Oracle Error:
    ORA-02089: COMMIT is not allowed in a subordinate session
    Why?How Can I resolve my problem?Can Anyone Help Me?Thanks...It sounds like you have transactional syntax embedded in your
    procedure. You can't do that and still include it in an XA
    transaction.
    Joe

  • Size limitation that can be passed to Java stored procedure

    Hello!
    I enjoy using Oracle8i these days. But I have some questions
    about Java stored procedure. I want to pass the XML data to Java
    stored procedure as IN parameter. But I got some errors when the
    data size is long. Is there any limitation in the data size that
    can be passed to Java stored procedure?
    Would you please help me ?
    This message is long, but would you please read my message?
    Contents
    1. Outline : I write what I want to do and the error message I
    got
    2. About the data size boundary: I write about the boundary
    size. I found that it depend on which calling sequence I use.
    3. The source code of the Java stored procedure
    4. The source code of the Java code that call the Java stored
    procedure
    5. The call spec
    6. Environment
    1.Outline
    I want to pass the XML data to Java stored procedure. But I got
    some errors when the data size is long. The error message I got
    is below.
    [ Error messages and stack trace ]
    java.sql.SQLException: ORA-01460: unimplemented or unreasonable
    conversion reque
    sted
    java.sql.SQLException: ORA-01460: unimplemented or unreasonable
    conversion reque
    sted
    at oracle.jdbc.ttc7.TTIoer.processError(Compiled Code)
    at oracle.jdbc.ttc7.Oall7.receive(Compiled Code)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(Compiled Code)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch
    (TTC7Protocol.java:721
    at oracle.jdbc.driver.OracleStatement.doExecuteOther
    (Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch
    (Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecute(Compiled
    Code)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Compiled
    Code
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate
    (OraclePrepar
    edStatement.java:256)
    at oracle.jdbc.driver.OraclePreparedStatement.execute
    (OraclePreparedStat
    ement.java:273)
    at javaSp.javaSpTestMain.sample_test
    (javaSpTestMain.java:37)
    at javaSp.javaSpTestMain.main(javaSpTestMain.java:72)
    2. About the data size boundary
    I don|ft know the boundary that I got errors exactly, but I
    found that the boundary will be changed if I use |gprepareCall("
    CALL insertData(?)");|h or |gprepareCall ("begin insertData
    (?); end ;")|h.
    When I use |gprepareCall(" CALL insertData(?)".
    The data size 3931 byte ---&#61664; No Error
    The data size 4045 byte ---&#61664; Error
    Whne I use prepareCall ("begin insertData(?); end ;")
    The data size 32612 byte --&#61664;No Error
    The data size 32692 byte ---&#61664; Error
    3. The source code of the Java stored procedure
    public class javaSpBytesSample {
    public javaSpBytesSample() {
    public static int insertData( byte[] xmlDataBytes ) throws
    SQLException{
    int oraCode =0;
    String xmlData = new String(xmlDataBytes);
    try{
    Connection l_connection; //Database Connection Object
    //parse XML Data
    dits_parser dp = new dits_parser(xmlData);
    //Get data num
    int datanum = dp.getElementNum("name");
    //insesrt the data
    PreparedStatement l_stmt;
    for( int i = 0; i < datanum; i++ ){
    l_stmt = l_connection.prepareStatement("INSERT INTO test
    " +
    "(LPID, NAME, SEX) " +
    "values(?, ?, ?)");
    l_stmt.setString(1,"LIPD_null");
    l_stmt.setString(2,dp.getElemntValueByTagName("name",i));
    l_stmt.setString(3,dp.getElemntValueByTagName("sex",i));
    l_stmt.execute();
    l_stmt.close(); //Close the Statement
    l_stmt = l_connection.prepareStatement("COMMIT"); //
    Commit the changes
    l_stmt.execute();
    l_stmt.close(); //Close the Statement l_stmt.execute
    (); // Execute the Statement
    catch(SQLException e ){
    System.out.println(e.toString());
    return(e.getErrorCode());
    return(oraCode);
    4. The source code of the Java code that call the Java stored
    procedure
    public static void sample_test(int num) {
    //make data
    Patient p = new Patient();
    byte[] xmlData = p.generateXMLData(num);
    try{
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    Connection m_connection = DriverManager.getConnection
    ("jdbc:oracle:thin:@max:1521:test",
    "testuser", "testuser");
    CallableStatement l_stmt =
    // m_connection.prepareCall(" CALL insertData(?)");
    m_connection.prepareCall("begin insertData(?); end
    l_stmt.setBytes(1,xmlData);
    l_stmt.execute();
    l_stmt.close();
    System.out.println("SUCCESS to insert data");
    catch(SQLException e ){
    System.out.println( e.toString());
    e.printStackTrace();
    5. The call spec
    CREATE OR REPLACE PROCEDURE insertData( xmlData IN LONG RAW)
    AS
    LANGUAGE JAVA NAME 'javaSp.javaSpBytesSample.insertData(byte[])';
    6. Environment
    OS: Windows NT 4.0 SP3
    RDBMS: Oracle 8i Enterprise Edition Release 8.1.5.0.0 for
    Windows NT
    JDBC Driver: Oracle JDBC Drivers 8.1.5.0.0.
    JVM: Java1.1.6_Borland ( The test program that call Java stored
    procedure run on this Java VM)
    null

    Iam passing an array of objects from Java to the C
    file. The total size of data that Iam sending is
    around 1GB. I have to load this data into the Shared
    memory after getting it in my C file. Iam working on
    HP-UX (64-bit). Everything works fine for around 400MB
    of data. When I try to send around 500MB of data, the
    disk utilization becomes 100%, so does my memory
    utilization and I get a "Not enough space" when I try
    to access shared memory. I have allocated nearly 2.5GB
    in my SHMMAX variable. Also, I have around 45GB of
    disk free. The JVM heap size is also at 2048MB. Where did you get the 400/500 number from? Is that the size of the file?
    What do you do with the data? Are you doing nothing but copying it byte for byte into shared memory?
    If yes then a simple test is to write a C application that does the same thing. If it has problems then it means you have an environment problem.
    If no then you are probably increasing the size of the data by creating a structure to hold it. How much overhead does that add to the size of the data?

  • Debug messages in Stored Procedure

    is it possible to see the debug messages written in the Stored Procedure when invoking it from WLS.
    using wls 8.1 SP3
    DB :Sybase
    Driver : weblogic.jdbc.sybase.SybaseDriver
    setting debug parameters (
    -Dweblogic.Debug=weblogic.JDBCConn,weblogic.JDBCSQL,weblogic.JTAJDBC
    )is not enough. also using P6Spy does not help here ...

    Yuval Avni wrote:
    is it possible to see the debug messages written in the Stored Procedure when invoking it from WLS.
    using wls 8.1 SP3
    DB :Sybase
    Driver : weblogic.jdbc.sybase.SybaseDriver
    setting debug parameters (
    -Dweblogic.Debug=weblogic.JDBCConn,weblogic.JDBCSQL,weblogic.JTAJDBC
    )is not enough. also using P6Spy does not help here ...Hi. If/when Sybase sends informational messages to the client, a driver will typically
    make them available from the statement or connection or even result set via SQLWarnings.
    Try the getWarnings() methods of those objects.
    Joe

  • Passing Variable Number of Parameters to Cobol Stored Procedure

    Hi. I have a web front end that needs to access several different tables via Cobol stored procedures. It seems simple enough to call the stored procedures straight away (DAO Pattern perhaps?) but my boss is insistent on having an intermediate Cobol program that decides which table to access. I think he at a bigger picture than I can see.
    The problem lies in the number of parameters that need to be passed to the stored procedures; some need 3, others needs 5, a few need 4. The only two solutions that I can think of are to pass EVERYTHING (we're talking 50 parameters or so) to the intermediate stored procedure and then pulling only what is needed from that data set to access the desired table. Solution number two involves passing everything to a temp table and then pulling what is needed from it. The former solution seems a little cleaner but still involves passing a lot of parameters. If Cobol could handle some sort of dynamic memory allocation (Vector) there seems to be a possible solution there. Though, as far as I know, that isn't possible.
    Any ideas are much appreciated.
    Thanks in advance,
    Chris

    Hi Saurabh,
    The method in which stored procedures are called on form submit is something as follows.
    Let us take your scenario of a form which has multiple checkboxes and a submit button. On clicking the submit button, this form data is submitted using either get or post. The form's submit action invokes a procedure.
    The HTML form code will look something like this..
    htp.formOpen( curl => 'URL /myProcedure',
    cmethod => 'post' );
    htp.formCheckbox( cname => 'myCheckbox'
    cvalue => 'A');
    htp.formCheckbox( cname => 'myCheckbox'
    cvalue => 'B');
    htp.formCheckbox( cname => 'myCheckbox'
    cvalue => 'C');
    htp.formSubmit( cname => 'myButton',
    cvalue => 'OK');
    Now, whenever the submit button is clicked, all these form values are passed to our stored procedure 'myProcedure'.
    "myProcedure" looks something like this.
    procedure myProcedure
    myCheckbox IN sys.owa_util.vc_arr,
    myButton IN VARCHAR2
    is
    begin
    end myProcedure;
    The point to be noted here is that the name of the variable being passed in the procedure is the same as the name of the HTML element being created in the HTML form. So, there is a direct mapping between the elements in the HTML form and the procedure parameters.
    Another noteworthy point is that since you have multiple checkboxes in your HTML form, it is impractical to name all the checkboxes differently and then pass those many parameters to your procedure (Imagine a scenario where there are a hundred check-boxes in an HTML form!). So portal allows you to give the same name (cname) to all the checkboxes in your HTML form, and if multiple checkboxes are checked, it will return all the checkbox values in an array (Note the usage of "myCheckbox IN sys.owa_util.vc_arr" in myProcedure).
    You can check out this link for more information.
    Re: retrieving data from fields
    Thanks,
    Ashish.

  • Stored procedure in reports

    hi all,
    Have any one used stored procedure to populate data for reports
    also publish a sample code which illustrates the above said issue

    thank u chida,
    nice reply it seems that the report triggers are of much useful.
    please reply me about the usage of the report triggers
    i can know about the utility and criticality of the triggers available in reports, also it will be useful for me in interview point-of-view in future.
    expecting a reply

  • JDBC stored procedure / java.lang.IllegalArgumentException

    Hi,
    I have created a JDBC adapter to access for a Oracle DB and the connection works successfully. I have tested the posting into the DB via xml-format and it works also fine.
    Accordingly i added a stored procedure (SP) into the xml-format and i get following error in the communication channel (in Pi monitoring the message is fine - no error):
    com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request
    in sax parser: Error when executing statement for table/stored proc.
    'em_end_load' (structure 'STATEMENT_StoreProcedure'):
    java.lang.IllegalArgumentException
    SP in DB:
    PROCEDURE em_end_load
        p_1                      IN  VARCHAR2,
        p_2                      IN  VARCHAR2    DEFAULT NULL,
        p_3                      IN  NUMBER,
        p_4                      IN  VARCHAR2    DEFAULT NULL,
        p_time                      IN  DATE        DEFAULT NULL
    AS
    I'm not sure if i have to use an output parameter, because in the description of the SP i read following:
    USAGE
         To compile from the SQL*Plus prompt:
         SQL> start [folder spec]/sp_em_end_load.pls
         To run from the SQL*Plus prompt:
         SQL> exec em_em_end_load
    PARAMETERS
         INPUT
            p_1
            p_2
            p_3
            p_4
          p_5
          p_6
         OUTPUT
            p_error_msg
    I have created in PI the data type for SP as follow:
                             value
    MT_JDBC
      STATEMENT_SP          0..1
         action          required     EXECUTE
         table          0..1          em_end_load
         p_1          1..1          010
           type          optional     VARCHAR
         p2               1..1          main
           type          optional     VARCHAR
         p3               1..1          100
           type          optional     VARCHAR
         p4               1..1          load
           type          optional     VARCHAR
         p5               1..1          26.04.2010
           type          optional     DATE
         p_error_msg     0..1          
           isInput          optional     1
           type          otpional     VARCHAR
    What is wrong with the processing of this SP? Could anyone help me?
    Regards,
    Lutz

    Sorry the explanation of the data type was a little bit misunderstanding:
    data type in PI:
    MT_JDBC
    -STATEMENT_SP           0..1
    --action                required        EXECUTE
    --table                 0..1            em_end_load
    --p_1                   1..1            010
    ---type                 optional        VARCHAR
    --p_2                   1..1            main
    ---type                 optional        VARCHAR
    --p_3                   1..1            100
    ---type                 optional        VARCHAR
    --p_4                   1..1            load
    ---type                 optional        VARCHAR
    --p_time                1..1            26.04.2010
    ---type                 optional        DATE
    --p_error_msg           0..1
    ---isInput              optional        1
    ---type                 optional        VARCHAR
    ...but the names of the parameters are identical - that i have checked several times.

  • Stored procedure with cursor as output param

    It's the first time for me to test a stored procedure with a cursor as output parameter. I executed the following:
    SQL> VARIABLE user_cur REFCURSOR; VARIABLE ret_code VARCHAR2; exec TEST_API.SEARCH_USER( :ret_code, '', '', 'john', '', :user_cur); print ret_code;print user_cur;
    I got the following error:
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
    VARCHAR2 (n CHAR) | NCHAR | NCHAR (n) |
    NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR ] ]
    May I know what's the problem?
    The purpose of the stored procedure is to search for user with the name "john".
    The stored procudure input/output params declaration is as follows:
    PROCEDURE SEARCH_USER
    RETURN_CODE OUT VARCHAR2,
    USER_ID_IN IN VARCHAR2,
    POSITION_IN IN VARCHAR2,
    USERNAME_IN IN VARCHAR2,
    STATUS_IN IN VARCHAR2,
    USER_CUR_OUT OUT REFCURSOR
    Edited by: user7383310 on Oct 19, 2008 9:05 PM
    Edited by: user7383310 on Oct 19, 2008 9:05 PM

    for the usage of refcursors in pl/sql refer here..
    http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10807/06_ora.htm#sthref808
    You can code like..
    SQL> create or replace procedure p1(id number,csr out sys_refcursor) is
      2  begin
      3   open csr for select ename from emp where deptno = id;
      4  end;
      5  /
    Procedure created.
    SQL> var csr1 refcursor
    SQL> var n number
    SQL> exec :n := 30;
    PL/SQL procedure successfully completed.
    SQL> exec p1(:n,:csr1);
    PL/SQL procedure successfully completed.
    SQL> print csr1
    ENAME
    ALLEN
    WARD
    MARTIN
    BLAKE
    TURNER
    JAMES
    6 rows selected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Cfdocument: font not rendering

    Hi: I have a webpage that prints a photo with text underneath that is in specific fonts. This works fine when it is rendered as a normal webpage: the fonts display exactly as they should, but when I wrap the code with a CFDOCUMENT tage the fonts reve

  • How to drop datafiles in oracle 10g r2

    Hi all, Db :oracle 10.2.0.3 os:solaris 10 tablespace name: jllp_tabs01 datafile: /ora/data001/jllp/jllp_tbs01_tbl_1.dbf /ora/data001/jllp/jllp_tbs01_tbl_2.dbf /ora/data001/jllp/jllp_tbs01_tbl_3.dbf /ora/data001/jllp/jllp_tbs01_tbl_4.dbf its has consi

  • Is there any OSS note for this DTP failure???

    I have loading from DSO to open hub...using DTP.(BI 7 system).It fails frequently..can anybody suggest me some patches needed for this....I have got manual solution..but if somebody..give me OSS note etc..then it will be great help... regards, Neo

  • What's the background of making Adobe Audition?

    It's a rhetorical question. As I can see, Adobe Audition is a poser software, not for doing things efficiently, but just to pose with Adobe family. This family is too big and no one is a outstanding. Maybe Premiere, but that's another story. I was a

  • Open Catalog Interface (OCI)

    There is an OCI interface for SAP R3. Is there an OCI interface for Business One?