RefCursor Mapping

Anybody know how to map the output of a refcursor to a file via the transform? We have been playing with modifying the xsl to get it to loop and set the values, but it doesn't seem to output the way we would want it too.
So if we have a refcursor that outputs 25 rows and 4 columns I would expect to be able to map those 4 columns to a file or another insert, etc.
The refcursor output is completely different then dropping in a select. It doesn't create the collection with the column values.
Thanks,
S

Anybody use refcursors to pull data using BPEL? If not how do you pull data from the dbs? Just usuing custom SQL?

Similar Messages

  • Ref cursor to object  and return to ref cursor

    how i will call object type from refcursor and return value to ref cursor .

    I need a help. please help me.
    takes oracle object types as input/output.
    PROCEDURE createserviceorder(
    P_serviceorder IN serviceorder,
    P_serviceid in out p_sm_type.serviceid,
    P_serviceorderid out p_sm_type.serviceorderid,
    Returnstatus out callstatus);
    The serviceorder, callstatus are oracle object types.
    The wrapper procedure for this API would be something like the example with pseudo code below
    PROCEDURE createserviceorderwrapper(
    P_serviceorder IN REFCURSOR,
    P_serviceid in out p_sm_type.serviceid,
    P_serviceorderid out p_sm_type.serviceorderid,
    Returnstatus out REFCURSOR)
    Map from ref cursor P_serviceorder to oracle object for serviceorder;
    Map from other data types to local variables;
    Call createserviceorder (pass the parameters here and get output….);
    Map output callstatus to its equivalent REF CURSOR variable;
    Return callstatus (and other out parameters if any )as REF CURSORS;
    }

  • Mapping refcursors with object types in a procedure

    Hi all,
    I need some help regarding the mapping of refcursors with object types .
    Example: Procedure "A" has object types as input/output parameters which lies in the Web Method Application as a API.
    We are creating a procedure "B" which has ref cursors as input/ouput parameters
    which will map to the Procedure "A"'s object type parameters.
    It will be highly needful for the solution.
    Regards
    Saugata

    Your pseudocode has a lot of steps in it, but you didn't say which step you need help with. Since I already covered going from a nested table type to a refcursor, I'll assume you want an example that goes the other way now, like from a refcursor to a nested table type. Here's one ...
    SQL>
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create type nested_table_type as table of varchar2(14) ;
      2  /
    Type created.
    SQL> show errors
    No errors.
    SQL>
    SQL>
    SQL> create function func
      2    ( p_cursor in sys_refcursor )
      3    return nested_table_type
      4  as
      5    v_nested_table nested_table_type ;
      6  begin
      7
      8    fetch p_cursor bulk collect into v_nested_table ;
      9    return( v_nested_table );
    10
    11  end;
    12  /
    Function created.
    SQL> show errors
    No errors.
    SQL>
    SQL> select func( cursor( select dname from dept ) ) as nested_table from dual ;
    NESTED_TABLE
    NESTED_TABLE_TYPE('ACCOUNTING', 'RESEARCH', 'SALES', 'OPERATIONS')If your cursor selects objects instead of simple data types, the code is pretty much the same.
    SQL> create type object_type as object ( c1 varchar2(14), c2 varchar2(13) );
      2  /
    Type created.
    SQL> show errors
    No errors.
    SQL>
    SQL> create type nested_table_type as table of object_type ;
      2  /
    Type created.
    SQL> show errors
    No errors.
    SQL>
    SQL>
    SQL>
    SQL> create function func
      2    ( p_cursor in sys_refcursor )
      3    return nested_table_type
      4  as
      5    v_nested_table nested_table_type ;
      6  begin
      7
      8    fetch p_cursor bulk collect into v_nested_table ;
      9    return( v_nested_table );
    10
    11  end;
    12  /
    Function created.
    SQL> show errors
    No errors.
    SQL>
    SQL> select
      2    func( cursor( select object_type( dname, loc ) from dept ) ) as object_table
      3  from dual ;
    OBJECT_TABLE(C1, C2)
    NESTED_TABLE_TYPE
      ( OBJECT_TYPE('ACCOUNTING', 'NEW YORK'),
        OBJECT_TYPE('RESEARCH', 'DALLAS'),
        OBJECT_TYPE('SALES', 'CHICAGO'),
        OBJECT_TYPE('OPERATIONS', 'BOSTON')
      )(NB I manually reformated the query results for clarity).

  • Problem in Mapping RefCursors(in/out parameter) and Collections(in/out)

    Hi,
    Can anyone help to solve the proble listed below as it is affecting the business process
    The API for A is listed below. It takes Oracle Object types as input/output.
    PROCEDURE A(
    p_serviceOrder IN ServiceOrder,
    p_serviceID IN OUT p_sm_type.ServiceID,
    p_serviceOrderID OUT p_sm_type.ServiceOrderID,
    returnStatus OUT CallStatus);
    The ServiceOrder and CallStatus are Oracle Object types.
    The wrapper procedure for this api would be something like the example with pseudo-code below.
    PROCEDURE B(
    p_serviceOrder IN REF CURSOR,
    p_serviceID IN OUT p_sm_type.ServiceID,
    p_serviceOrderID OUT p_sm_type.ServiceOrderID,
    returnStatus OUT REF CURSOR) {
    Map from REF CURSOR p_serviceOrder To Oracle Object for ServiceOrder;
    Map from other data types to local variables;
    Call A(pass the parameters here and get output…);
    Map output CallStatus to its equivalent REF CURSOR variable;
    Return CallStatus (and other OUT parameters if any) as REF CURSORs;
    It will be highly needful for the solution as it is affecting the business flow requirement.
    Regards
    Saugata

    Hi,
    i think you must set the value for this parameter and additional you must
    register this parameter as out parameter.
    I hope it works.

  • How to pass a refcursor to a java stored proc

    Hi all,
    Please forgive me as I am new to Java and JDeveloper....
    I want to pass a refcursor to a java stored proc. Does anyone know how to accomplish this?
    Thanks,
    dayneo

    Hi,
    As Avi has indicated, you can map ref cursor to java.sql.ResultSet
    here are Call Specs and a code snippet from chapter 3 in my book.
    procedure rcproc(rc OUT EmpCurTyp)
    as language java
    name 'refcur.refcurproc(java.sql.ResultSet[])';
    function rcfunc return EmpCurTyp
    as language java
    name 'refcur.refcurfunc() returns java.sql.ResultSet';
    * Function returning a REF CURSOR
    public static ResultSet refcurfunc () throws SQLException
    Connection conn = null;
    conn = DriverManager.getConnection("jdbc:oracle:kprb:");
    ((OracleConnection)conn).setCreateStatementAsRefCursor(true);
    Statement stmt = conn.createStatement();
    ((OracleStatement)stmt).setRowPrefetch(1);
    ResultSet rset = stmt.executeQuery("select * from EMP order by empno");
    // fetch one row
    if (rset.next())
    System.out.println("Ename = " + rset.getString(2));
    return rset;
    Kuassi

  • Edmx cannot mapped stored procedure column info not displaying

    Hi,
    I'm trying to follow the QBE on how to mapped stored proedure in EF.
    Everything works fine until I need to Add Import Function where I could not see the list of column info.
    I'm using .NET 4.5, EF 5.0, 11gR3 DB, VS 2012 & ODP 11.2.0.3.60 (beta)
    Below is my app.config.
    <oracle.dataaccess.client>
    <settings>
    <add name="HR.UPDATE_AND_RETURN_SALARY.RefCursor.NEW_SALARY" value="implicitRefCursor bindinfo='mode=Output'" />
    <add name="HR.UPDATE_AND_RETURN_SALARY.RefCursorMetaData.NEW_SALARY.Column.0" value="implicitRefCursor metadata='ColumnName=FIRST_NAME;BaseColumnName=FIRST_NAME;BaseSchemaName=HR;BaseTableName=EMPLOYEES;NATIVEDATATYPE=Varchar2;ProviderType=Varchar2'" />
    <add name="HR.UPDATE_AND_RETURN_SALARY.RefCursorMetaData.NEW_SALARY.Column.1" value="implicitRefCursor metadata='ColumnName=SALARY;NATIVEDATATYPE=Number;ProviderType=Int32'" />
    </settings>
    </oracle.dataaccess.client>
    As far as I can tell it seems like VS would use the tags above to figure out the return column info and create a complex type. I could not see why it is not recognizing it.
    Please note that I can access an Oracle table successfully and display rows in VS.
    Thanks in advance

    I'm not sure if you're the person that just logged a SR on this, but I just recently worked the same issue.
    It turns out that
    a) if you don't pay attention, adding a new Oracle Connection in Server Explorer defaults to the MANAGED ODP.NET (you can still create a connection using UnManaged though).
    b) the metadata for MANAGED ODP.NET is different than the metadata for UNManaged. Here's the correct mapping for MANAGED ODP:
    oracle.manageddataaccess.client>
        <version number="*">
          <implicitRefCursor>
            <storedProcedure schema="HR" name="UPDATE_AND_RETURN_SALARY">
              <refCursor name="NEW_SALARY">
                <bindInfo mode="Output" />
                <metadata columnOrdinal="0" columnName="FIRST_NAME" providerType="Varchar2" nativeDataType="Varchar2" />
                <metadata columnOrdinal="1" columnName="SALARY" providerType="Double" nativeDataType="Number" />
              </refCursor>
            </storedProcedure>
          </implicitRefCursor>
        </version>
      </oraclemanaged.dataaccess.client>

  • How to use Oracle refcursor dataset output parameter from SP

    Can I request for help on how to use Oracle Output parameter from a stored procedure as a source. I need the output tobe stored in a flat file
    Thanks
    Abhijit
    Message was edited by:
    Abhijit77

    yes I would like to use it for ODI.. I would like the ouput of the refcursor to be fed to a text file using ODI. How to handle the records returned by the refcursor and map with txt file.

  • Refcursor IN

    Hello All,
    I'm using oracle 11gR2
    One of our user wants all their LOVs maintained thru a UI. They have close to 50 LOV tables with no. of fields ranging from 5 to 10 with mostly different names.
    I'm trying to write a generalized package to get the values, set the values and delete the values. We have permissions/privileges being checked before any of the DML being performed.
    for the get procedure, I'm returning a refcursor when they pass in the table name (may not be ideal but....had to) and now starting to work on the set procedure (insert new values). Some of the issues that I'm trying to address is that the number of fields are not constant, the field names are different etc..
    Would passing in a refursor work for this scenario? or is there better ways of doing it? Please shed some light.
    Thanks in advance
    NU

    >
    One of our user wants all their LOVs maintained thru a UI. They have close to 50 LOV tables with no. of fields ranging from 5 to 10 with mostly different names.
    I'm trying to write a generalized package to get the values, set the values and delete the values. We have permissions/privileges being checked before any of the DML being performed.
    Some of the issues that I'm trying to address is that the number of fields are not constant, the field names are different
    >
    First you need to quit focusing on the solution you seem to want to use (ref cursor) and get back to focusing on defining the problem and the requirements.
    Once the complete requirements are available you can start looking for solutions that can be used.
    >
    I'm trying to write a generalized package
    >
    Well you can't do that if the requirements (column names and number of columns) for the 50 LOVs are different.
    You either have to make the number and names of columns the same (using a view perhaps) or you will need more than one 'generic' set of code (that is, one for each set of LOVs that is consistent.
    What UI are you talking about? A Java middle-tier? You may have a choice of where to put the business rules: in the middle tier so the back-end code is more generic or in the back-end.
    I suggest you first need to review the 50 LOVs and determine how many similar sets of them that you have.
    Some common attirbutes might be: 1) actual attribute name, 2) display name, 3) actual attribute value, 4) display value/format
    The 'display' attributes are what the business user wants displayed and the name they want to use to refer to the attribute ('State Code'). The 'actual' attributes are what is really used in the back-end ('STATE_CD'). For generics you want to use a mapping table so you can map the business name to the actual name and break the dependency.
    The key thing is what I said above. Focus on nailing down the requirements. The correct solution will be more readily apparent when you know for sure what all of the issues are.

  • Remote System and Remote Key Mapping at a glance

    Hi,
    I want to discuss the concept of Remote System and Remote Key Mapping.
    Remote System is a logical system which is defined in MDM Console for a MDM Repository.
    We can define key mapping enabled at each table level.
    The key mapping is used to distinguish records at Data Manager after running the Data Import.
    Now 1 record can have 1 remote system with two different keys but two different records cannot have same remote system with same remote key. So, Remote key is an unique identifier for record for any remote system for each individual records.
    Now whenever we import data from a Remote System, the remote system and remote key are mapped for each individual records. Usually all records have different remote keys.
    Now, when syndicating back the record with default remote key is updated in the remote system that is sent by xml file format.
    If same record is updated two times from a same remote system, the remote key will be different and the record which is latest contains highest remote key.
    Now, I have to look at Data Syndication and Remote key.
    I have not done Data Syndication but my concept tell if there is duplicate record with same remote system but different remote keys both will be syndicated back. But if same record have two remote keys for same remote system then only the default remote key is syndicated back.
    Regards
    Kaushik Banerjee

    You are right Kaushik,
    I have not done Data Syndication but my concept tell if there is duplicate record with same remote system but different remote keys both will be syndicated back.
    Yes, but if they are duplicate, they needs to be merged.
    But if same record have two remote keys for same remote system then only the default remote key is syndicated back.
    This is after merging. So whichever remote key has tick mark in key mapping option(default) , it will be syndicated back.
    Pls refer to these links for better understanding.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/80eb6ea5-2a2f-2b10-f68e-bf735a45705f
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/7051c376-f939-2b10-7da1-c4f8f9eecc8c%0c
    Hope this helps,
    + An

  • Error while deleting a mapping

    Hi all,
    I am getting the following error while deleting a mapping. My client version is 10.2.0.4.36
    API5072: Internal Error: Null message for exception. Please contact Oracle Support with the stack trace and details on how to reproduce it.
    oracle.wh.util.Assert: API5072: Internal Error: Null message for exception. Please contact Oracle Support with the stack trace and details on how to reproduce it.
         at oracle.wh.util.Assert.owbAssert(Assert.java:51)
         at oracle.wh.ui.jcommon.OutputConfigure.showMsg(OutputConfigure.java:216)
         at oracle.wh.ui.common.CommonUtils.error(CommonUtils.java:370)
         at oracle.wh.ui.common.WhDeletion.doActualDel(WhDeletion.java:512)
         at oracle.wh.ui.common.WhDeletion.deleteObject(WhDeletion.java:203)
         at oracle.wh.ui.common.WhDeletion.deleteObject(WhDeletion.java:283)
         at oracle.wh.ui.jcommon.tree.WhTree.deleteItem(WhTree.java:346)
         at oracle.wh.ui.console.commands.DeleteCmd.performAction(DeleteCmd.java:50)
         at oracle.wh.ui.console.commands.TreeMenuHandler$1.run(TreeMenuHandler.java:188)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:189)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:478)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    Thanks in advance!
    Sebastian

    These type of Internal Errors are all too common in OWB and it's difficult to diagnose the exact problem.
    I'd suggest closing the Design Centre, going back in and trying to delete it again, this will often resolve Internal errors.
    There's also an article on Metalink Doc ID: 460411.1 about errors when deleting mappings but it's specific to an ACLContainer error, so may or may not be of use.
    One of the suggestions is to connect as the Repository Owner rather than a User and try to delete the mapping.
    Cheers
    Si
    Edited by: ScoobySi on Sep 10, 2009 11:44 AM

  • FileName in ABAP XSLT Mapping

    Dear SDN,
    In an integration scenario we are using sender File Adapter and a  ABAP XSLT Mapping.
    Is there any way to get the source FileName from such mapping.  Im trying to use the adapter-specific message attributes, but it doesn't work, and I didn´t find an example, probably I and doing somthing wrong.
    regards,
    GP

    Thank you for your help,
    I just try to access the adapter-specific attibutes using:
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:variable name="filename"  select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
    </xsl:stylesheet>
    but the following error raised:
    <SAP:Stack>Error while calling mapping program YXSLT_TEST (type Abap-XSLT, kernel error ID CX_XSLT_RUNTIME_ERROR) Call of unknown function</SAP:Stack>
    have you had this situation?

  • Sample source code for fields mapping in expert routine

    Hi All
    Iam writing the expert routine from dso to cube for example I have two fields in dso FLD1,FLD2
    same fields in infocube also ,can any body provide me sample abap code to map source fields to target fields in expert routine,your help will be heighly appreciatble,it's an argent.
    regards
    eliaz

    Basic would be ;
    RESULT_FIELDS -xxx = <SOURCE_FIELDS> -xxx
    you have the source fields as source, and result fields for as the target. In between you can check some conditions as in other routines of transformation.
    BEGIN OF tys_SC_1, shows your source fields ( in your case DSO chars and key figures)
    BEGIN OF tys_TG_1, , shows your result fields ( in your case Cube characteristics)
    Hope this helps
    Derya

  • How can I distinguish different action mapping in one ActionClass file?

    I would like to create a ActionClass which will handle 3 mapping which comes from /add, /show or /del.
    My question is how can I change the code so that the ActionClass servlet can distinguish the request from different url mapping ? Can anyone give me some short hints? Thx.
    struts-config.xml
    <action-mappings>
    <action name="MemberInfoForm" path="/add" scope="request" type="com.myapp.real.MemberAction">
    <action name="MemberInfoForm" path="/show" scope="request" type="com.myapp.real.MemberAction">
    <action name="MemberInfoForm" path="/del" scope="request" type="com.myapp.real.MemberAction">
    </action-mappings>MemberAction.class
    public class MemberAction extends org.apache.struts.action.Action {
        private final static String SUCCESS = "success";
        public ActionForward execute(ActionMapping mapping, ActionForm  form,
                HttpServletRequest request, HttpServletResponse response)
                throws Exception {
            return mapping.findForward(SUCCESS);
    ...

    http://struts.apache.org/1.2.x/api/org/apache/struts/actions/MappingDispatchAction.html
    http://struts.apache.org/1.2.x/api/org/apache/struts/actions/DispatchAction.html
    Thank you so much for all of your suggestion.
    I read the document of MappingDispatchAction and its note say:
    NOTE - Unlike DispatchAction, mapping characteristics may differ between the various handlers, so you can combine actions in the same class that, for example, differ in their use of forms or validation.........
    I wonder in DispatchAction, we can also have various forms or validation as MappingDispatchAction does, just by using different name in the action tag, for example:
    <action input="/p1.jsp" name="MForm1" path="/member" scope="session" parameter="action" type="com.myapp.real.MemberAction">
    <action input="/p2.jsp" name="MForm2" path="/member" scope="session" parameter="action" type="com.myapp.real.MemberAction">
    <action input="/p3.jsp" name="MForm3" path="/member" scope="session" parameter="action" type="com.myapp.real.MemberAction">Hence, it is not the difference as stated from the NOTE, right?
    Edited by: roamer on Jan 22, 2008 10:32 AM

  • How can I save to the same map every time when printing pdfs?

    How can I save to the same map every time when printing pdfs?
    Finder points to the document map even when I chose a different map recently.
    I often print series of pdfs from the print dialog box, I'd like to choose the map to save to and then have all subsequent pdf prints automatically directed to the same map until I decide otherwise.

    that link seems to be broken right now:
    403 Error - Forbidden  - No cred, dude.

  • Sensor Mapping Express VI's performanc​e degrades over time

    I was attempting to do a 3d visualization of some sensor data. I made a model and managed to use it with the 3d Picture Tool Sensor Mapping Express VI. Initially, it appeared to work flawlessly and I began to augment the scene with further objects to enhance the user experience. Unfortunately, I believe I am doing something wrong at this stage. When I add the sensor map object to the other objects, something like a memory leak occurs. I begin to encounter performance degradation almost immediately.
    I am not sure how I should add to best add in the Sensor Map Object reference to the scene as an object. Normally, I establish these child relationships first, before doing anything to the objects, beyond creating, moving, and anchoring them. Since the Sensor Map output reference is only available AFTER the express vi run. My compromise solution, presently, is to have a case statement of controlled by the"First Call" constant. So far, performace seems to be much better.
    Does anyone have a better solution? Am I even handling these objects the way the community does it?
    EDIT: Included the vi and the stl files.
    Message Edited by Sean-user on 10-28-2009 04:12 PM
    Message Edited by Sean-user on 10-28-2009 04:12 PM
    Message Edited by Sean-user on 10-28-2009 04:16 PM
    Solved!
    Go to Solution.
    Attachments:
    test for forum.vi ‏105 KB
    chamber.zip ‏97 KB

    I agree with Hunter, your current solution is simple and effective, and I can't really visualize a much better way to accomplish the same task.
    Just as a side-note, the easiest and simplest way to force execution order is to use the error terminals on the functions and VIs in your block diagram. Here'a VI snippet with an example of that based on the VI you posted. (If you paste the image into your block diagram, you can make edits to the code)
    Since you expressed some interest in documentation related to 3D picture controls, I did some searching and found a few articles you might be interested in. There's nothing terribly complex, but these should be a good starting point. The first link is a URL to the search thread, so you can get an idea of where/what I'm searching.You'll get more hits if you search from ni.com rather than ni.com/support.
    http://search.ni.com/nisearch/app/main/p/q/3d%20pi​cture/
    Creating a 3D Scene with the 3D Picture Control
    Configuring a 3D Scene Window
    Using the 3D Picture Control 'Create Height Field VI' to convert a 2D image into a 3D textured heigh...
    Using Lighting and Fog Effects in 3d Picture Control
    3D Picture Control - Create a Moving Texture Using a Series of Images
    Changing Set Rotation and Background of 3D Picture Control
    Caleb Harris
    National Instruments | Mechanical Engineer | http://www.ni.com/support

Maybe you are looking for

  • Problem while testing a BAPI Web Service

    i face this problem in web service bapi when i am carrying out the test... so can anyone help me??? HTTP/1.1 500 Internal Server Error Set-Cookie: <value is hidden> content-type: text/xml; charset=utf-8 content-length: 803 sap-srt_id: 20080610/144609

  • How to find infinite loop?

    Dear Oracle Gurus, I have one (some?) problem and no idea what to do. Our platform is IBM xSeries 234, RHEL3, 10g (version ...0.2). Database has only Oracle Application Repository shemas. Here is output from OS: #ps aux ... oracleandja (LOCAL=NO) -Mo

  • Tableview using filter - wrong DataBinding?

    Using a filter in my tableview made me notice a behaviour of which I don't know if I forgot some important detail or just discovered something ... System: WebAS 6.20, SP45 In my tableview I use data binding quite extensively, and after implementing a

  • Third party sales processing issue

    Hi, I have a batche managed materail which i am processing for the first time with Third party sales. I have created deklivery for the material . but when i am creating the Billing docuemnt , system is asking for Goods issue. As there is no stock in

  • C.'\program files hp digital imaging bin hpqstp08.rsc

    the moment i turn the computer on  this massage come up imagen incorrect c.'\program files hp digital imaging bin hpqstp08.rsc i have unintall and intall the software and it still shows error .... HP HELP PLEASE..................................