Adfbc with stored procedure

Is it possible to create ADFBC view object with a pl/sql stored procedure with an OUT variable ? Any examples ? JDev1013 here
Thanks

Considering that all you seem to want to do is call a stored procedure and return a single OUT parameter, I'm not sure why you want a view object at all. Why not implement a method in your application module's implementation class that returns that single value? Any public method that is exposed for clients in an application module is available in the data control created from that module.
Here is sample code from one of my application module implementation classes:
public String getCurrentState() {
    String currentState;
    try {
        CallableStatement s =
            getDBTransaction().createCallableStatement("BEGIN ? := SYS_CONTEXT('TEDS_CTX','CURRENT_STATE'); END;",
                                                       1);
        s.registerOutParameter(1, Types.VARCHAR);
        s.execute();
        currentState = s.getString(1);
        s.close();
    } catch (SQLException e) {
        throw new JboException(e);
    return currentState;
}Mine calls a function, but you can just move the question mark to the position of the OUT parameter in your stored procedure and get rid of the assignment operator. You can also add IN parameters.

Similar Messages

  • Problem With Stored Procedure

    Post Author: Ranjith.403
    CA Forum: General
    Hi,
    Am new to crystal reports with stored procedures
    am created a report using a stored procedure in oracle. In that Stored Procedure am Using a temporary table.
    After inserting values into the table am assigning to ref cursor.
    Refcursor having fields like item,onhandstock,purchase rate
    This report working fine in oracle version 9.2.0.1.0 where comes to oracle version 9.2.0.8.0 it's giving the varchar values correctly.
    The Number values are showing as 0.
    Help me to solve it.
    Thanks in Advance,
    Ranjith

    Try modularising this large procedure into smaller procedures and functions, and determine which part is causing you trouble.

  • Report with Stored Procedure does not return until refresh

    I'm using RAS server 2008 to run many Crystal reports from a web application (TrackWise) over Oracle 10g DB.
    A new report is using a stored procedure that takes several minutes (5-10) to return before the rest of the report's SQL can execute.
    When running the report from Crystal Developer there is no problem,
    but when running from the application (using the RAS), the report seems to be running forever,
    However, if you wait a few minutes for the DB utilization to drop (i.e. for the stored procedure to finish) and refresh - the full report appears on the screen in a second.
    Since I have many other reports that run for much longer time with no issue, I assume that this has nothing to do with the web application, but rather related to the connection between the RAS and the DB (i.e. the idle time between the beginning of the stored procedure execution to its return and the continuation of the report creation).
    I assume that I need to change one of the RAS settings/ parameters (in the properties or in the registry), but which?
    Please assist.

    Since this app is from TrackWise, I'd recommend contacting TrackWise and see if they have an answer for you. As it is, we have no idea how they implemented the CR components in their app. If they cannot help you, it should be them coming here and asking us - or better yet they should be creating a phone incident.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Passing parameters from vb form to a crystal report with stored procedure

    Can someone give me an idea how to use data inputted on vb form to be use as basis of crystal report generation which loads data from a stored procedure. Stored procedure has parameters that was also set in the crystal report. viewing on crystal report is ok but i am having difficulty running the report from vb.

    Hi John,
                  If Not CRRpt.ParameterFields("AgeType") Is Nothing Then
                        CRRpt.ParameterFields("AgeType").CurrentValues.Clear()
                        Dim ParamValue As new CrystalDecisions.Shared.ParameterDiscreteValue
                        ParamValue.Value = AgeType.ToString 
                        CRRpt.ParameterFields("AgeType").CurrentValues.Add(ParamValue)
                    End If
    Note that the ParamValue.Value should be assigned with exact same data type as you declared it in CR.
    If it is string, Convert your Variable to string first.
    If it is date, make sure you are passing a date variable.
    and so on...
    Regards
    Edy

  • Receive java.lang.NullPointerException (JCA-12563) on SCA with Stored Procedure dbAdapter (SOA Suite 12.1.3)

    Hi,
    I'm new to the Oracle SOA Suite and have been creating very simple SCA WebServices (async and sync) prototypes to INSERT, UPDATE and Poll Oracle 9i and 11g databases. So far, everything works and passes the tests from EM.
    I cannot get the Stored Procedure WebService to test successfully as I receive the error message below regardless of JNDI configuration for XA, non-XA, Last Logging Resource, Support Global Transactions,PlatformClassName, etc...  The Outbound Connection Pool is setup correctly as the other DML tests have worked fine.
    BINDING.JCA-12563
    Exception occurred when binding was invoked.
    Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'dbReference' failed due to: Interaction processing error.
    Error while processing the execution of the IFSAPP.TEST_SOA_API API interaction.
    An error occurred while processing the interaction for invoking the IFSAPP.TEST_SOA_API API. Cause: java.lang.NullPointerException
    Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD.  This exception is considered not retriable, likely due to a modelling mistake.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
    Caused by: BINDING.JCA-12563
    Exception occurred when binding was invoked.
    Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'callAPI' failed due to: Interaction processing error.
    Error while processing the execution of the IFSAPP.TEST_SOA_API API interaction.
    An error occurred while processing the interaction for invoking the IFSAPP.TEST_SOA_API API. Cause: java.lang.NullPointerException
    Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD.  This exception is considered not retriable, likely due to a modelling mistake.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
       at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:569)
        at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeJcaReference(JCAInteractionInvoker.java:724)
        at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeAsyncJcaReference(JCAInteractionInvoker.java:689)
        at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAEndpointInteraction.performAsynchronousInteraction(JCAEndpointInteraction.java:628)
        at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:325)
        ... 84 more
    Caused by: BINDING.JCA-11812
    Interaction processing error.
    Error while processing the execution of the IFSAPP.TEST_SOA_API API interaction.
    An error occurred while processing the interaction for invoking the IFSAPP.TEST_SOA_API API. Cause: java.lang.NullPointerException
    Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD.  This exception is considered not retriable, likely due to a modelling mistake.
        at oracle.tip.adapter.db.exceptions.DBResourceException.createNonRetriableException(DBResourceException.java:690)
        at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:656)
        at oracle.tip.adapter.db.sp.SPUtil.createResourceException(SPUtil.java:180)
        at oracle.tip.adapter.db.sp.SPInteraction.executeStoredProcedure(SPInteraction.java:183)
        at oracle.tip.adapter.db.DBInteraction.executeStoredProcedure(DBInteraction.java:1302)
        at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:307)
        at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:415)
    Caused by: java.lang.NullPointerException
        at oracle.tip.adapter.db.sp.SPInteraction.executeStoredProcedure(SPInteraction.java:162)
        ... 91 more
    The SP SCA is the simplest possible application I can think of...  The WebService accepts a single INT, calls BPEL>Receive>Assign>Invoke>dbAdapter(Stored Procedure) that accepts a single IN INTEGER parameter in an Oracle 11g database.
    Steps I've used to create the SP SCA. (Create Empty SOA Application)
    1.) Create Database Adapter in External References swim lane.
    2.) Set JNDI and Connection.
    3.) Browse to Oracle Procedure...click through Wizard and accept all defaults.
       CREATE OR REPLACE PROCEDURE TEST_SOA_API (
         wo_order_no_ IN INTEGER)
       IS
       BEGIN
         INSERT INTO TEST_TMP VALUES (wo_order_no_);
       END;
    4.) WSDL, XSD, JCA are automatically generated. 
    5.) Create BPEL Process Component and select Template "Base on a WSDL".  I choose the WSDL created from the Database Adapter wizard.
    6.) The "Exposed Service" is automatically created and everything is wired.
    7.) I deploy to my CompactDomain (running on a local Oracle12 db).  No errors.
    8.) I login to EM and Test the WebService..and ALWAYS receive the error message above.
    I've tried BPEL Process and Mediator as components to simply pass the single incoming INT parameter to the SP DbAdapter and tried every combination I can think of with DataSource/DbAdapter Deployment through the Admin console.  I used the same exact steps above for INSERT, UPDATE, Polling and have had no issues so I cannot figure out why I'm not receiving java.NullPointer exception or why I'm receiving the XML/XSD malformation error.
    Stuck now...anyone have an idea what I'm doing wrong or simply tell me I'm an idiot and shouldn't do SP's this way?
    FYI.  I've turned on logging for the oracle.soa.adapter.db class to TRACE: 32(FINEST).  Not much help to me
    [2015-04-02T09:03:55.706-05:00] [AdminServer] [WARNING] [ADF_FACES-00007] [oracle.adf.view.rich.render.RichRenderer] [tid: 118] [userId: weblogic] [ecid: 852497f1-b648-4cac-9cee-05e7972ce68e-00000788,0] [APP: em] [DSID: 0000KluHqzk0NuGayxyWMG1L7K52000003] Attempt to synchronized unknown key: viewportSize.
    [2015-04-02T09:05:23.971-05:00] [AdminServer] [TRACE] [] [oracle.soa.adapter.db.outbound] [tid: 115] [userId: <anonymous>] [ecid: 852497f1-b648-4cac-9cee-05e7972ce68e-000007db,1:17474] [APP: soa-infra] [oracle.soa.tracking.FlowId: 250004] [oracle.soa.tracking.InstanceId: 1270014] [oracle.soa.tracking.SCAEntityId: 90004] [composite_name: OraclePLSQL2!1.0] [FlowId: 0000KluSpyP0NuGayxyWMG1L7K52000007] [SRC_CLASS: oracle.tip.adapter.db.sp.AbstractStoredProcedure] [SRC_METHOD: execute]  [composite_version: 1.0] [reference_name: dbReference] BEGIN IFSAPP.TEST_SOA_API(WO_ORDER_NO_=>?); END;
    [2015-04-02T09:05:23.972-05:00] [AdminServer] [TRACE] [] [oracle.soa.adapter.db.outbound] [tid: 115] [userId: <anonymous>] [ecid: 852497f1-b648-4cac-9cee-05e7972ce68e-000007db,1:17474] [APP: soa-infra] [oracle.soa.tracking.FlowId: 250004] [oracle.soa.tracking.InstanceId: 1270014] [oracle.soa.tracking.SCAEntityId: 90004] [composite_name: OraclePLSQL2!1.0] [FlowId: 0000KluSpyP0NuGayxyWMG1L7K52000007] [SRC_CLASS: oracle.tip.adapter.db.sp.AbstractStoredProcedure] [SRC_METHOD: execute]  [composite_version: 1.0] [reference_name: dbReference] Bindings [WO_ORDER_NO_=>INTEGER(2343)]
    WSDL
    <wsdl:definitions
         name="dbReference"
         targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/OraclePLSQL2/OraclePLSQL2/dbReference"
         xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/OraclePLSQL2/OraclePLSQL2/dbReference"
         xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
         xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
         xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        >
      <plt:partnerLinkType name="dbReference_plt" >
        <plt:role name="dbReference_role" >
          <plt:portType name="tns:dbReference_ptt" />
        </plt:role>
      </plt:partnerLinkType>
        <wsdl:types>
         <schema xmlns="http://www.w3.org/2001/XMLSchema">
           <import namespace="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference"
                   schemaLocation="../Schemas/dbReference_sp.xsd" />
         </schema>
        </wsdl:types>
        <wsdl:message name="args_in_msg">
            <wsdl:part name="InputParameters" element="db:InputParameters"/>
        </wsdl:message>
        <wsdl:portType name="dbReference_ptt">
            <wsdl:operation name="dbReference">
                <wsdl:input message="tns:args_in_msg"/>
            </wsdl:operation>
        </wsdl:portType>
    </wsdl:definitions>
    XSD
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference" elementFormDefault="qualified">
       <element name="InputParameters">
          <complexType>
             <sequence>
                <element name="WO_ORDER_NO_" type="int" db:index="1" db:type="INTEGER" minOccurs="0" nillable="true"/>
             </sequence>
          </complexType>
       </element>
    </schema>
    Payload XML
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
            <soap:Body>
                    <ns1:InputParameters xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference">
                            <ns1:WO_ORDER_NO_>667</ns1:WO_ORDER_NO_>
            </ns1:InputParameters>
        </soap:Body>
    </soap:Envelope>

    An even simpler request:
    Can someone create an SCA that simply accepts a single INT parameter and calls a Stored Procedure (Oracle) that inserts this INT into a table?  Maybe upload the project folder structure in a zip? 
    Seems someone with experience on this platform could execute this task in 10-15 minutes.
    CREATE TABLE TEST_TMP (WO_ORDER_NO INT);
       CREATE OR REPLACE PROCEDURE TEST_SOA_API (
         wo_order_no_ IN INTEGER)
       IS
       BEGIN
         INSERT INTO TEST_TMP VALUES (wo_order_no_);
       END;

  • Switching Data Source for a report with stored procedure

    Post Author: ysbn
    CA Forum: Data Connectivity and SQL
    I've created a report and deployed it on a Crystal Server. The report is based on a certain stored procedure which also exists on other DB machines in my environment (Oracle machines). When I try to switch my report object to work with other machines (not the one originally used when the report was designed) the activation of the report fails. The error I see in the preview window is:
    Error in File <my rpt file name>: Failed to retrieve data from the database. Details: &#91;Database Vendor Code: 6550 &#93;
    When I try the same thing with a report which is based on a view and not a stored procedure the switching of Data Source works perfectly.
    Is there a problem switching between data sources from the server when the report is based on stored procedure? Are there any configurations I need to do in order to support this scenario?
    Thanks!

    Hi everyone~
    i am now facing the same problem
    i am using CR2008 and Visual Studio 2008 c# to write a window program
    because we have 2 db environment (one is production , the other one is development) so i have set a prarameter to switch db connection in c# code.
    the database is Oracle, and the the report will connect to Oracle procedure (which it is stored in package) this procedure will return reference cursor, so the report will loop up this cursor to generate report.
    at first time, it work fine when i open the report in CR2008 designer and point to dev database (ie datasource point to oracle procedure) . but when i want to deploy this win application to client and point to prod database, it show (vendor error 6550)
    i found that i cannot change the datasource during runtime in c# code...
    am i miss something in code? here attached a part of this code...
    private void setDBLogonForReport(ConnectionInfo info, ReportDocument doc)
                Tables myTables = doc.Database.Tables;
                foreach (Table myTable in myTables)
                    TableLogOnInfo logOnInfo = myTable.LogOnInfo;
                    logOnInfo.ConnectionInfo = info;
                    logOnInfo.TableName = myTable.Name;
                    myTable.ApplyLogOnInfo(logOnInfo);
                    //myTable.Location = info.UserID + "." + "pkg_crystal_report." + myTable.Name;
                    //someone suggest i have to set the 'Location' for change the datasource, but i am not sure how to construct a 
                    //string for point to oracle prcedure
    i will check it freq ... hope any expert can give me some advice ~
    thank you very much!!!

  • Insert Multiple records using Database adapter with Stored procedure func

    Hi All,
    I want to insert multiple records on a database using a stored procedure. I wanted to insert those records using a Database Adapter and the Database adapter should be invoked by a Mediator.
    Can somebody suggest me with ideas whether it can be acheived with OOB capabtilities in SOA suite or not?
    Thanks for your help in advance.
    Thanks,
    Shiv

    The use case you want to achieve is feature supported by the DBAdapter and it is possible to invoke the same from mediator.
    Please have a look at the oracle documentation and you should be able to get the necessary information.
    The below links should help you as well:
    http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10231/adptr_db.htm
    http://blogs.oracle.com/ajaysharma/2011/03/using_file_adapter_database_adapter_and_mediator_component_in_soa_11g.html
    There are some video tutorials as well :)
    http://www.youtube.com/watch?v=dFldS-fDx70 This should also help
    Thanks,
    Patrick

  • How to use optional prompts with stored procedure universe?

    Hi Experts,
    Iu2019m working on stored procedure universe in BO XI 3.0 SP2 FP2.5 with oracle at back end. My requirement is that I have to pass 5 optional prompts in the report and we have to pass these prompts through open document link. Please tell if this can be worked out on stored procedure universe?
    Thanks in advance.

    Hi,
    Try with OpenDoc syntax as follows.
    http://<servername>:<port>/OpenDocument/opendoc/<plat
    formSpecific>?iDocID=****&sIDType=CUID&sType=wid/rpt&lsM/lsS/lsRPROMPTNAME=[V1],[V2]&sDocName=reportname&sRefresh=Y/N
    where
    server name: cms server name
    port: portno
    <platformspecific>=: for java -> openDocument.jsp
                                      for .net -> opendocument.aspx
    idocid,sDocName & cuid -> we can get report properties ( goto info view -> select report -> right click -> properties i.e. doc id, cuid and report name)
    sType -> type of report i.e webi or deski ...
    lsS -> to pass single prompt value
    lsM -> to pass multiplle values to prompt
    lsR -> range of values ....
    Note: Here prompt name should be same as the one which we used in the report. Use + if there is blank space.
    Cheers,
    Suresh Aluri.

  • Report with stored procedures is unable to run in infoview.

    I developed report for my current employer using stored procedures and saved it to Enterprise environment. When running this report I am getting following Error in Infoview:
    Error in File ~tmp26285c856bf1180.rpt: Failed to retrieve data from the database. Details: [Database Vendor Code: -674 ]
    I can run my same report in Crystal Reports. Previous developer was using data source tables instead of stored procedures and report with tables were running successfully in infoview. What should I need to do in order to recognise my stored procedures in Infoview.
    We use informix databases.
    Regards,
    Rashid Khan

    The above issue have been resolved the issue. The problem was our BO administrator changed the Database server on CMC and my report in infoview was failing because of my stored procedure was not found on new database.

  • Executing a report with stored procedure causes error

    Hello,
    I've got a .NET application where a report gets generated from an .rpt template using Crystal Reports. A template has been created using the fields from stored procedure. While creating the template, I've been working with my DEV environment DB server, and with that server the .rpt has been saved. Within the Designer, I can preview the report, all working fine.
    Using the template with my application, if I set in the code for crystal connection to use the same DB server as has been saved with the .rpt, the report runs and I do get the result in my application as expected. But if I move my code to other environment, using another DB server (but not changing anything in the .rpt), while running the report in the application I get the following error:
    Exception: CrystalDecisions.CrystalReports.Engine.InternalException
    Message: Failed to open a rowset.
    Details: ADO Error Code: 0x
    Source: Microsoft OLE DB Provider for SQL Server
    Description: Could not find stored procedure 'BreachOfAgg'.
    SQL State: 42000
    Native Error:
    Failed to open a rowset.
    Error in File C:\Windows\TEMP\Breach of Aggregate Stop Loss {196B84E5-7DAE-465E-A12D-5C70DDC04CE5}.rpt:
    Failed to open a rowset.
    Source: CrystalDecisions.ReportAppServer.DataSetConversion
       at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToHttpResponse(ExportOptions options, HttpResponse response, Boolean asAttachment, String attachmentName)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToHttpResponse(ExportFormatType formatType, HttpResponse response, Boolean asAttachment, String attachmentName)
       at IFG.ReportsModule.Reporter.CrystalReporter.Export(OutputType outputType, HttpResponse response, String reportName, Boolean asAttachment)
       at IFG.ReportsModule.Reporter.CrystalReporter.Export(OutputType outputType, HttpResponse response, String reportName)
       at IFG.ReportsModule.Proxies.CrystalReporterProxy.ShowResult(OutputType outputType, HttpContext context, CrystalReporter cr)
       at IFG.ReportsModule.Proxies.CrystalReporterProxy.ExecuteReport(ParametersValues parameters, OutputType outputType, HttpContext context)
       at IFG.Web.GetReport.GenerateReport(Int64 reportID) in d:\Jure\PSL\iFish\IFISHRSF\IFISHRSF0100\Root\5. Development\IFISH Portal\SDRMA New\Portal\web\admin\RSF\GetReport.aspx.cs:line 82
       at IFG.Web.GetReport.Page_Load(Object sender, EventArgs e) in d:\Jure\PSL\iFish\IFISHRSF\IFISHRSF0100\Root\5. Development\IFISH Portal\SDRMA New\Portal\web\admin\RSF\GetReport.aspx.cs:line 48
    Nested Exception
    Exception: System.Runtime.InteropServices.COMException
    Message: Failed to open a rowset.
    Details: ADO Error Code: 0x
    Source: Microsoft OLE DB Provider for SQL Server
    Description: Could not find stored procedure 'BreachOfAgg'.
    SQL State: 42000
    Native Error:
    Failed to open a rowset.
    Error in File C:\Windows\TEMP\Breach of Aggregate Stop Loss {196B84E5-7DAE-465E-A12D-5C70DDC04CE5}.rpt:
    Failed to open a rowset.
       at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
       at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
    If I open in the Crystal Designer the rpt and change the DB to my new server, and then run the report in the application using that same new server, the report runs ok and I do get the results. As well, I don't have this problem using tables or views in the report. Independent of what server has been used while created the .rpt in the Designer, I get the report ran and presented according to the server that I point to within my code.
    I hope someone can help me out with thi.
    Thank you.
    Jure

    Hi Jure,
    All I can suggest now is you try this [app|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533353333333933323331%7D.do]:
    It will get the connection if you need.
    If that doesn't work the purchase a support and Rep can connect to your PC to see what is going on...
    Thanks
    Don

  • Sender JDBC with Stored Procedure or Function

    Hi.
    I have a problem to update a row that I obtain from sender JDBC (using SELECT or calling to a FUNCTION).
    As the consultation is so complex and the table has fed up transactions, often it takes the registry “A” and updates register “B”.
    Try to use the level of transaction “Serializable” (/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter) but it throws the following error to me:
    "The JDBC driver returned the following error message: 'java.sql.SQLException: ORA-08177: can't serialize access for this transaction '. For details, contact your database server vendor."
    Try to invoke to a function (/people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter) but when placing a sentence of UPDATE within the function throws an error, I reviewed to me and calling to a function from a SELECT, Oracle it does not allow to modify registries of the database.
    Some other suggestion?

    Hi,
    See this link,
    Here is an example of mapping for synch JDBC.
    /people/siva.maranani/blog/2005/09/16/xi-how-to-on-jdbc-receiver-response
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Also go thru these links:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm
    Regards,
    Akshay Jamgaonkar.
    Reward points if find useful.

  • MultiSelect Parameter with Stored Procedure not working

    I am using Crystal Reports 2008 and SQL Server 2008. I am using a stored procedure which works with a multiselect in SQL side. I am using a string to table utility function in the where clause with the In statment like below:
    WHERE FORMULARY_ID in
    --(@FORMULARY_ID)
      (SELECT Extractedtext
       FROM ClarityTST.[rpt].[LHfn_StringToTable]( @FORMULARY_ID, ',') ) 
    When I try to use the stored procedure I get an error message:
    "The stored procedure cannot accept multiple values. Please ensure that the multiple value is set to False:"
    I would like to use it with multiple parameters.

    Crystal uses arrays to handle multiple values.  As far as I'm aware, there is no way to get a multi-valued report parameter into SQL (command or SP) directly.  In the past, I have used a "shell" main report that gets the parameters, used Join() to concatenate the selected values into a single string, then pass that to the "main" subreport, and into its SQL or SP.  The SQL than would need to find the database field in the string.  If you make the string passed to the subreport valid SQL for an IN clause, you could do it that way, too.
    HTH,
    Carl

  • Probleme with stored procedure in oracle 10 g

    I create a stored procedure for archiving successfully compile but when I select t_sql_statement i have 0 rows :( :(
    create or replace
    PROCEDURE p_archive_test(piv_owner varchar2)
    is
    lv_stmt varchar2(2000) := 'insert /*+ append */ into TABLE1 (COLUMNS)
                                                                     select INS_COLUMNS
                                                                     from TABLE2 tab2@db1
                                                                     where not exists (select null
                                                                                         from TABLE1 tab1
                                                                                         where PKCOLUMNS
    cursor c_tab is
    select tab.table_name,'ERR$_'||tab.table_name ERR_TABLE
    from all_tables tab
              where tab.owner = piv_owner
    -- and tab.table_name = 'action'
    --order by atb.TABLE_ORDER
    -- For each table get the primary key columns     
    cursor c_pk(civ_table_name in all_tables.TABLE_NAME%type)
    is
    select acl.COLUMN_NAME
    from all_cons_columns acl
    ,all_constraints acn
    where acn.OWNER = piv_owner
    and acn.CONSTRAINT_TYPE = 'P'
    and acn.TABLE_NAME = civ_table_name
    and acl.OWNER = acn.OWNER
    and acl.TABLE_NAME = acn.table_name
    and acl.CONSTRAINT_NAME = acn.CONSTRAINT_NAME
    order by acl.POSITION;
    -- For each table get the corresponding table columns names
    cursor c_ins_cols(civ_table_name in all_tab_columns.TABLE_NAME%type)
    is
    select 'tab2.'||atc.COLUMN_NAME column_name
    from all_tab_columns atc
    where atc.OWNER = piv_owner
    and atc.TABLE_NAME = civ_table_name
    order by atc.COLUMN_ID;
    -- For each table get the columns names excluding the primary key columns
    cursor c_upd_cols(civ_table_name in all_tab_columns.TABLE_NAME%type)
    is
    select 'tab1.'||atc.COLUMN_NAME||'=tab2.'||atc.column_name column_name
    from all_tab_columns atc
    where atc.OWNER = piv_owner
    and atc.TABLE_NAME = civ_table_name
    and not exists (select 1
    from all_cons_columns acl
    ,all_constraints acn
    where acl.OWNER = atc.owner
    and acl.TABLE_NAME = atc.TABLE_NAME
    and acl.column_name = atc.column_name
    and acn.OWNER = acl.OWNER
    and acn.TABLE_NAME = acl.TABLE_NAME
    and acn.constraint_type = 'P')
    order by atc.COLUMN_ID;
    -- For each table get the columns names
    cursor c_cols(civ_table_name in all_tab_columns.COLUMN_NAME%type)
    is
    select
    --'tab1.'||
    atc.COLUMN_NAME column_name
    from all_tab_columns atc
    where atc.owner = piv_owner
    and atc.TABLE_NAME = civ_table_name
    order by atc.COLUMN_ID;
    lv_cols varchar2(4000);
    lv_pk_cols varchar2(4000);
    lv_ins_cols varchar2(4000);
    lv_upd_cols varchar2(4000);
    BEGIN
    for r_tab in c_tab
    loop
    lv_cols := '';
    lv_pk_cols := '';
    lv_ins_cols := '';
    lv_upd_cols := '';
    for r_pk in c_pk(civ_table_name => r_tab.table_name)
         loop
    lv_pk_cols := lv_pk_cols||'tab1.'||r_pk.column_name||'=tab2.'||r_pk.column_name||' and ';
    end loop r_pk_loop;
    lv_pk_cols := substr(str1 => lv_pk_cols
    ,pos => 1
    ,len => length(ch => lv_pk_cols) - 5);
    for r_ins_cols in c_ins_cols(civ_table_name => r_tab.table_name)
    loop
    lv_ins_cols := lv_ins_cols||r_ins_cols.column_name||',';
    end loop r_ins_cols_loop;
    lv_ins_cols := substr(str1 => lv_ins_cols
    ,pos => 1
    ,len => length(ch => lv_ins_cols) - 1);
    for r_upd_cols in c_upd_cols(civ_table_name => r_tab.table_name)
         loop
    lv_upd_cols := lv_upd_cols||r_upd_cols.column_name||',';
    end loop r_upd_cols_loop;
    lv_upd_cols := substr(str1 => lv_upd_cols
    ,pos => 1
    ,len => length(ch => lv_upd_cols) - 1);
    for r_cols in c_cols(civ_table_name => r_tab.table_name)
         loop
    lv_cols := lv_cols||r_cols.column_name||',';
    end loop r_cols_loop;
    lv_cols := substr(str1 => lv_cols
    ,pos => 1
    ,len => length(ch => lv_cols) - 1);
    lv_stmt := replace(replace(replace(replace(replace(replace(replace(lv_stmt
    ,'TABLE1'
    ,r_tab.table_name)
    ,'TABLE2'
    ,'DIST_'||r_tab.table_name)
    ,'PKCOLUMNS'
    ,lv_pk_cols)
    ,'UPD_COLUMNS'
    ,lv_upd_cols)
    ,'INS_COLUMNS'
    ,lv_ins_cols)
    ,'COLUMNS'
    ,LV_COLS)
    ,'TABLE3'
    ,R_TAB.ERR_TABLE);
    -- here It highy advisable to store the sql statement that will be submitted
    -- to the SQL engine before executing it dynamically
    insert into t_sql_statement values (lv_stmt);
    execute immediate lv_stmt;
    end loop ;
    commit;
    exception
    when others then
    rollback;
    raise;
    end p_archive_test;

    Welcome to the forum!
    Unfortunately you have posted to the wrong forum. This question is not about sql developer and is more appropriate for the sql and pl/sql forum
    PL/SQL
    Please
    1. repost the question in the SQL and PL/SQL forum
    2. edit this question to tell people to followup in the other forum - post the link to the question in the other forum
    3. mark this question answered so people will followup in the other forum.
    Read the FAQ in the other forum (there will be link at the top right of the page) for how to post a question and the information you need to provide. In particular use 'code' tags (see FAQ for explanation) before and after posted code and always provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    Before you post the new thread I suggest you perform some additional testing by
    1. Modify your code so that it creates the statements but does not execute them. With dynamic sql the most common problem is incorrect syntax and until you have verified that the syntax is both correct and exactly what you want it is a waste of time to execute the statements.
    2. Modify your code to only create one statement (add WHERE ROWNUM = 1 to the main query). If the syntax is wrong it will be wrong for all of the statements so until the code works correctly for one loop it is a waste of time perform 10's or 100' of loops.
    3. Currently you are not committing the creation of the statement itself but only after it is executed. Thus if the execution fails the query that failed won't be available for you to examine. Either commit the INSERT or, at a minimum capture the query into a global variable and add a DBMS_OUTPUT to the exception handler to display the failed query so you can examine and test it to fix any problem.
    Also, by just blindly using the data in ALL_TAB_COLS you are not taking into account that Oracle creates hidden (see the hidden column) and virtual columns that will cause your processing to fail for any tables that use them since you cannot use them directly in queries like you are creating.

  • Is BC4J a viabl option for database with stored procedure (ref cursor) API?

    I'm about to begin a Web application development project. As foundation, we have a (Oracle) database of certain complexity that have a data access API developed with PL/SQL packages.
    This API is designed to get data through stored procedures/functions that return REF CURSOR.
    Personally I have been investigating about Oracle ADF/JSF, and a number of others J2EE technologies, and at this moment I am doubting if ADF BC are a viable option to my development team.
    I think this because I have noticed that one of the great drawback in ADF BC is the lack of simplicity to get data through stored procedures/functions that returns REF CURSORS.
    I have been looking for documentation and the only thing that I have found are two examples:
    1.- One that really do not work (fails in get data from ref cursor): ADF BC StoredProcedure Sample application.
    2.- And other published by Steve Muench in
    http://radio.weblogs.com/0118231/stories/2003/03/03/gettingAViewObjectsResultRowsFromARefCursor.html. This sample works fine.
    But, the problem with the approach of this last article is the amount (and complexity) of the code necessary to make so basic and recurrent operation as is "obtain data through a stored procedure (ref cursor)".
    Below it is the code that I have constructed to call a function that returns a ref cursor (based on steve's article).
    If this is the only way to make this (historically so basic and simple) task, then it is obvious that BC is not a viable technology to my (or I am in a mistake?), since we have about 50 stored procedures/functions to access the underlying data; that stored procedures/functions are key to development of the new application (and, still more, currently are used to anothers apps ).
    By all this, I would like consult to Oracle's people:
    1.- I really must reject BC as technology to implement this project ?
    2.- It is possible to access stored procedures in a simpler way using BC?
    3.- If the answer to 2 is NOT: in near future, the BC team has plans to give more support to the simple access to stored procedures?
    4.- If the answer to 3 is NOT: what another technology you recommend to construct my data access/business tier and still be able to using the others characteristics of ADF?
    Thank you very much for your guidelines.
    Regards, RL.
    ** And the code!!!
    ** ###   I am forced to do this for each call to a procedure???? ###
    package myrefcursor.model;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.SQLException;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.NullValue;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    public class TraePolizasViewImpl extends ViewObjectImpl {
        private static final String SQL = "begin ? := PKG_PRUEBA.trae_polizas(?);end;";
        private static final String COUNTSQL = "begin ? := PKG_PRUEBA.count_trae_polizas(?);end;";
        public TraePolizasViewImpl() {
        protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
            BigDecimal rut_contratante = null;
            Object[] theUserParam = null;
            System.out.println(params);
            System.out.println(params[0]);
            if (params != null)
                theUserParam = (Object[]) params[0];
            //if (theUserParam != null && theUserParam.length > 0 )
            if (! (theUserParam[1]   instanceof NullValue) )
                rut_contratante = (BigDecimal)theUserParam[1];
            storeNewResultSet(qc ,retrieveRefCursor(qc, rut_contratante));
            super.executeQueryForCollection(qc, params, numUserParams);
        protected void create() {
          getViewDef().setQuery(null);
          getViewDef().setSelectClause(null);
          setQuery(null);
        protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
          rs = getResultSet(qc);
          ViewRowImpl r = createNewRowForCollection(qc);
          try {
            populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
            populateAttributeForRow(r,1, rs.getString(2));
          catch (SQLException s) {
           throw new JboException(s);
          return r;
        protected boolean hasNextForCollection(Object qc) {
          ResultSet rs = getResultSet(qc);
          boolean nextOne = false;
          try {
            nextOne = rs.next();
            if (!nextOne) {
              setFetchCompleteForCollection(qc, true);
              rs.close();
          catch (SQLException s) {
           throw new JboException(s);
          return nextOne;
        protected void releaseUserDataForCollection(Object qc, Object rs) {
           ResultSet userDataRS = getResultSet(qc);
           if (userDataRS != null) {
            try {    userDataRS.close();    }
            catch (SQLException s) { ; }  
          super.releaseUserDataForCollection(qc, rs);
        public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
          return viewRowSet.getRowCount();
        private ResultSet retrieveRefCursor(Object qc, BigDecimal rut_contratante) {
          CallableStatement st = null;
          try {
            st = getDBTransaction().createCallableStatement(SQL, DBTransaction.DEFAULT);
            st.registerOutParameter(1,OracleTypes.CURSOR);
            if (rut_contratante == null)
                st.setNull(2, Types.NUMERIC);
            else
                st.setBigDecimal(2, rut_contratante);
            st.execute();
            ResultSet rs = ((OracleCallableStatement)st).getCursor(1);
            rs.setFetchSize(getFetchSize());
            return rs ;
          catch (SQLException s) {
            throw new JboException(s);
          finally {try {st.close();} catch (SQLException s) {;}}
        private void storeNewResultSet(Object qc, ResultSet rs) {
          ResultSet existingRs = getResultSet(qc);
          if (existingRs != null) {
            try {existingRs.close();} catch (SQLException s) {;}  
          setUserDataForCollection(qc,rs);
          hasNextForCollection(qc); // Prime the pump with the first row.
        private ResultSet getResultSet(Object qc) {
            return (ResultSet)getUserDataForCollection(qc);
        private static Number nullOrNewNumber(BigDecimal b) {
             try {
               return b != null ? new Number(b) : null;
             catch (SQLException s) { ; }
             return null;
        public BigDecimal getprutcontratante() {
            return (BigDecimal)getNamedWhereClauseParam("prutcontratante");
        public void setprutcontratante(BigDecimal value) {
            setNamedWhereClauseParam("prutcontratante", value);
    }

    no?

  • DateTime parameter issue with Stored Procedure CR XI

    Hello everyone.
    This error was touched on here previously but no answer provided.
    I am using Crystal Reports XI with SAP's BUSINESS ONE product. I have a report using a SQL Stored Procedure (SQL 2005). It has datetime parameters.
    The Stored Procedure (SP) works fine when executed from within the Management studio. I then created my report, connecting to the SP with an ODBC driver and all was great.
    But the add on being used for the report to be included in B1 requires OLE connectivity. No problem, all my reports (none of the others have SP's though), work fine with OLE.
    So I tried redirecting the report to use the OLE driver. But I get an error.
    I tried creating a new report with the SP using the OLE driver. Same message.
    I get the following:
    Query Engine Error: 'ADO Error Code: 0x80040e14
    Source: Microsoft SQL Native Client
    Description: Incorrect syntax near the keyword 'CONVERT'.
    SQL State: 42000
    Native Error: 156'
    My code does not include the word CONVERT anywhere.
    From what I can find on the web, this is supposedly an issue with the datetime parameter.  But despite a few people posting messages about this, I have yet to find the answer. None of the topics have had a reply that provides the fix.
    It seems to be something specific to OLE, since it works fine in ODBC. I am using SQL NATIVE CLIENT.
    Thanks in advance for any help.
    Mark

    Hi Alex. Thanks.
    One of my colleagues actually suggested a similar thing. He pointed out I should be using the MICROSOFT OLE DB PROVIDER FOR SQL SERVER (I had been doing so but somewhere along the line started using the Native driver).
    And yes, that worked like a charm.
    Thanks for your help.
    Mark

Maybe you are looking for

  • Server not found

    Hi, Wonder if anyone can assist. When attempting to sign in to Formscentral I am receiving the error: "Safari cannot find the server Safari can't open the page 'https://ims-na1.adobelogin.com/ims/authorize/v1?client_id=adobeformscentral&client_redire

  • Can I use a nano and video on same iTunes computer and library?

    If I have an ipod Video and I currently download songs from my iTunes to iPod, is it possible to just select a certain folder in iTunes to have put on my husband's nano. I was told to just changet he preferences in iTunes but do I need to do anything

  • Problems with c++ native methods

    hello to all ,      I am building an client-server application in java , which uses java native methods written in c++ .In every client's request , the applcation updates a hashtable .The hashtable is kept as an Object member variable in a java class

  • Changing SIM to a different country

    Hi everyone and especially someone who can help me please! I am in the UK on hutchinson three network using my BB bold with BIS. It is working great. Now I am going abroad to the Middle East for a couple of months on some contracting work. I have a S

  • Photoshop Help | New video features in CS6

    This question was posted in response to the following article: http://helpx.adobe.com/photoshop/using/new-video-features-photoshop-cs6.html