How to return multiple record with Oracle Native Web Service?

Dear all,
I would like to know that the oracle native web service can be able to return multiple records to client or not?
I successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)
Thank and Regards,
Zenoni

I successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)You could return a list (multiple values/records) in XML format (using XMLType or CLOB), or CSV, or JSON, or whatever.
function get_employees (p_department_id in number) return clob
as
begin
  return 'your_xml_string_here';
end get_employees;It would be up to the client (the caller of the web service) to extract the values from whatever format you decide upon, of course.
- Morten
http://ora-00001.blogspot.com

Similar Messages

  • How can I return multiple values with PL/SQL Web Services

    Hi,
    I'm new to developping Web Services. I'm doing some tests with JDeveloper and OC4J on my local machine with a Web Services based on a PL/SQL function within a package. Right now that function only returns one value. So the xml response only has one output.
    I'd like to know how can I return multiple values with my PL/SQL Web Service. For example, if I want to return an employee's name and id? And that the xml contains two output : <employee>, <empid>?
    Reginald
    ps : I have searched the forum and I couldn't find an answer to this question, if that has been discussed AND answered before, can you please post the link? Thanks

    Alright, I actually found my answer. Since this was asked I think as a followup somewhere else I'll give my answer.
    It is very simple, all you have to do is create an Object Type and then Return that object type. After that, JDeveloper will take care of everything and you will have an xml response with multiple values. Here
    {color:#ff0000}
    create or replace TYPE person AS OBJECT
    ( id_interv number,
    first_name VARCHAR2(50),
    last_name VARCHAR2(50),
    date_birth date
    );{color}
    Then your function used in your Web Service should look something like this :
    {color:#ff0000}
    function info_emp (p_empno IN VARCHAR2) RETURN person AS
    l_emp person := person(-1,'','','');
    BEGIN
    SELECT first_name
    ,last_name
    ,emp_no
    INTO l_emp.first_name
    ,l_emp.last_name
    ,l_emp.emp_no
    FROM emp
    WHERE upper(emp_no) = upper (emp_no);
    {color}
    {color:#ff0000}
    RETURN l_emp;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    l_emp := person (-1,'n/a','n/a','n/a');
    RETURN l_emp ;
    END info_emp;{color}
    {color:#ff0000}{color:#000000}After that, this is what the xml response looks like :{color}{color}
    &lt;first_name xsi:type="xsd:string"&gt;John&lt;/first_name&gt;
    &lt;last_name xsi:type="xsd:string"&gt;Doe&lt;/last_name&gt;
    &lt;emp_no xsi:type="xsd:string"&gt;0250193&lt;/emp_no&gt;

  • How can I return multiple values using Oracle 9i Web Services ?

    Hi, Is it possible to return multiple parameters using WebServices in general ? And if yes, how do we do it using Oracle 9i WebServices ?
    At my client usually I call
    return_value = SoapClient.MehtodName(param1, param2, param3)
    If i need more than one return_value...how do we handle that ?
    Thanks,
    -Krishna

    Anyone has any ideas about this ?
    And also if i want a collection in one of the input parameters...how to do that ?
    Does Oracle WS have any such support ? Or we have devise our own way like sending it by separators or something like that ?
    Thanks,
    Krishna

  • WS-I fails with Oracle Generated Web Service

    Hi
    I recently used WS-I Analyzer to analyze the HTTP Analyzer logs. I get the following error:
    SSBP1003
    The Content-Type header is not present.
    Element Location:
    lineNumber=19
    SSBP5101
    The message either (1) did not have a "Content-Type" HTTP header field, or (2) the "Content-Type" HTTP header field had a field-value whose media type was something other than "text/xml"
    Element Location:
    lineNumber=19
    Any ideas?

    I successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)You could return a list (multiple values/records) in XML format (using XMLType or CLOB), or CSV, or JSON, or whatever.
    function get_employees (p_department_id in number) return clob
    as
    begin
      return 'your_xml_string_here';
    end get_employees;It would be up to the client (the caller of the web service) to extract the values from whatever format you decide upon, of course.
    - Morten
    http://ora-00001.blogspot.com

  • How to keep multiple function modules under one Web service

    Hi Experts,
    I have Three RFC function modules and i need to create one web service for these three RFC function modules. I know How to crearte a web service for one function module.
    please suggest me How to keep multiple function modules under one Web service.
    Thanks in advance
    Lakshminarayana

    Hi Lakshmi,
    The best way to do it is to assign all the three RFC Enabled FM's to one function group. Later on the top menu in Utilities you get an option to Create a Webservice from a Function Group.
    You can create one single Webservice using all the the 3 FM's.
    I hope this helps.
    Thanks,
    Manu

  • How to update multiple records in Oracle ?

    Hi Guys,
    <b>I have to update multiple records from a file into Oracle Table...</b>
    I can successfully insert the multiple records into the table but can't update the multiple records into the table.
    when i am using UPDATE_INSERT only my first record of the file is getting updated in th e table..
    Please share your views with me.
    Regards,

    I solved it by making changes in the occurrence  parameter of data type ...:-)

  • How to returns multiple data with function in varray?

    Hi!
    I have 3 rows in my table and i want the return in VARRAY, but
    in my function bottom it works for only one row of my table.
    I don't know how to have the return of values in 3 rows of my table,
    it's possible to have multiple dimension in varray? Or another way for
    having that? Because i read after in java code this result.
    Now my result are :
    RetVal(1)= 504053
    RetVal(2)= 135058
    RetVal(3)= 206734
    I want like :
    RetVal(1)= 504053 Melanie Brown California
    RetVal(2)= 135058 John Smith Boston
    RetVal(3)= 206734 Roy Smith New York
    CREATE TYPE GPDEV.EMPARRAY is VARRAY(100) OF NUMBER
    CREATE FUNCTION MyName RETURN EMPARRAY
    AS
    l_data EmpArray := EmpArray();
    CURSOR c_emp IS SELECT MyTable
    FROM MyRow
    WHERE clientnumber is not null;
    BEGIN
    FOR MyTable IN c_emp LOOP
    l_data.extend;
    l_data(l_data.count) := MyTable.MyRow
    END LOOP;
    RETURN l_data;
    END;
    Thanks in advance for your help!
    Melanie

    Here is one approach...
    CREATE TYPE testType AS OBJECT (test_letter VARCHAR2(2), test_number NUMBER);
    DECLARE
    CURSOR cAAA IS
    select 'a' test_letter, 1 test_number FROM DUAL UNION ALL
    select 'b' test_letter, 2 test_number FROM DUAL UNION ALL
    select 'c' test_letter, 3 test_number FROM DUAL;
    TYPE vArray_testType is VARRAY(100) OF testType;
    testArray vArray_testType:=vArray_testType();
    y number:=0;
    BEGIN
    dbms_output.put('Adding items to varray...');
    FOR rec in cAAA LOOP
    y:=y+1;
    testArray.extend;
    testArray(y):= testType(
    test_letter => rec.test_letter,
    test_number=> rec.test_number);
    END LOOP;
    dbms_output.put_line('Done. ');
    dbms_output.put_line('Print contents of varray...');
    LOOP EXIT WHEN y = 0;
    dbms_output.put_line(testArray(y).test_letter||' '||testArray(y).test_number);
    y := y-1;
    END LOOP;
    dbms_output.put_line('END');
    END;

  • How to insert multiple records with a single query?

    Hi,
    I've to save a huge number of installments with their other information such as due on blah blah. Now, I want to add the all of these information at once with a single insert query.
    How can I do that?

    Hi
    What is your source data?
    If the source is external to the SQL Server (like a log file, Excel, CSV, JSON, XML, external application...) you can and should insert it all using Bulk Insert operation.
    Pls clarify what is your source data, and if you need more help using Bulk Insert.
    https://www.simple-talk.com/sql/learn-sql-server/bulk-inserts-via-tsql-in-sql-server/
    http://msdn.microsoft.com/en-us/library/ms188365.aspx
    [Personal Site] [Blog] [Facebook]

  • How to input multiple records in tables in web dynpro

    Hi
    In web dynpro table I am able to input data in first row only. How to input data in other rows.
    Thanks,
    Saurabh

    hi, okay..
    I summarize in 3 aspects:
    1.You want make the Table row play like "Input field"
    The solution is :
    In the table column, you set the cell editor as "Input field"
    2.You want to use the FILTER function
    The solution is :
    set Filter Value property and realize "OnFilter" event...
    3.You want to add Ready for Input rows to your table
    The solution is :
    You should make use of the Context Node bound to the table. The EXAMPLE coding:
      DATA lo_nd_flights TYPE REF TO if_wd_context_node.
      DATA lo_el_flights TYPE REF TO if_wd_context_element.
    * append the element with initial attribute value
      lo_nd_flights = wd_context->get_child_node( name = wd_this->wdctx_flights ).
      lo_el_flights = lo_nd_flights->CREATE_ELEMENT( ).
    * bind the newly created element
      lo_nd_flights->BIND_ELEMENT( new_item             = lo_el_flights
                                   set_initial_elements = abap_false ).
    4.You want to set N rows ready for input initially
    The solution is :
    Set the Row visible property..
    Best wishes.

  • How to pass SOAP Attachments with JAX-RPC Web Service

    I'm confused...
    This sample shows how to send/receive SOAP attachments by using the JAX-RPC Handler mechanism. Can somebody confirm if this is the preferred way to do this. I've seen an example wich does something like:
      public interface AttachmentService extends Remote {
        public String storeDocumentService(javax.activation.DataHandler dh, String filename) throws RemoteException;
      }and then uses JAX-RPC utilities to create wsdl, stubs and stuff. Does this have the same result, as what the OTN example shows (from an architecture perspective?
    Thx,
    Jan.

    Well, how an attachment is processed depends on your application logic...if your application logic requires to processing attachments and verify it before processing the SOAP message, handlers could be better option.
    If you need to process the attachment while processing the SOAP message, you can do it in the service implementation class.
    In both the cases you need to get access to SOAPMessage object and from there get the attachments with getAttachments method.

  • Multiple records with select option

    i have to use select option in selection screen, which wl take the multiple values but that select option wont act as a range, the select option is a session name  from sm35, the table from where data is retrieved is APQI, i have used  a parameter before using select option ,like:
    selection-screen begin of line.
    parameters: P_grpid like apqi-groupid.
    select-options: s_grpid like apqi-groupid.
    selection-screen end of line.
    AT-SELECTION SCREEN ON VALUE REQUEST FOR p-GRPID. " previous situation
    {the code starts
    FM F4 selection is called}
    AT-SELECTION SCREEN ON VALUE REQUEST FOR S_GRPID-low. " CURRENT situation
    FM F4 selection is called}
    now when i give data in slection screen for s_grpid-low then it works as a parametr, but it doesnt take multiple values at s_grpid when i have alos mentioned the same for s_grpid-high.
    Please tell me how to achive multiple records with select option, or u can also send a sample code if you have..
    Thanks
    Swarnali

    Hello Swarnali,
    You need to fill internal table of select-option once you got into the event AT SELECTION-SCREEN ON VALUE REQUEST FOR so_carr-LOW.
    so sudo code will be:
    AT SELECTION-SCREEN ON VALUE REQUEST FOR so_carr-LOW.
    Select data from table.
       so_carr-LOW = value
       append so_carr.
    You can also use NO INTERVAL to suppress the so_carr-HIGH value on selection screen.
    Thanks,
    Augustin.

  • Database Native Web Services : XMLTYPE parameter in PL/SQL with XMLSCHEMA?

    Hi,
    I would like to build a function with a XMLTYPE parameter which is schema based, something like this:
    CREATE FUNCTION xy (p_xml XMLTYPE XMLSCHEMA 'http://myschema.com') ...
    At the moment I do the following inside the code:
              l_xml := p_xml.createSchemaBasedXML('http://myschema.com');
              l_xml.schemavalidate();
              /* validate XML against XSD */
              l_nbr := l_xml.isschemavalidated();
    The purpose why I would like to directly put the schema in the declaration is that I would like to use this function as a Oracle Native Web Service. The web service doesn't know the structure of the xml parameter as the schema is not knows in the declaration.
    Thanks and kind regards,
    Andreas
    Edited by: mdrake on Nov 8, 2009 9:55 PM

    Just for kicks here's the best I can come up with..
    SQL> connect &USERNAME/&PASSWORD
    Connected.
    SQL> --
    SQL> --
    SQL> --
    SQL> declare
      2    XMLSCHEMA XMLTYPE := XMLTYPE(
      3  '<!-- edited with XML Spy v4.0 U (http://www.xmlspy.com) by Mark (Drake) -->
      4  <xs:schema targetNamespace="http://xmlns.example.com/xsd/purchaseOrder"
      5             xmlns="http://xmlns.example.com/xsd/purchaseOrder"
      6             xmlns:xs="http://www.w3.org/2001/XMLSchema"
      7             xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
      8          <xs:element name="PurchaseOrder" type="PurchaseOrderType" xdb:defaultTable="PURCHASEORDER"/>
      9          <xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
    10                  <xs:sequence>
    11                          <xs:element name="Reference" type="ReferenceType" xdb:SQLName="REFERENCE"/>
    12                          <xs:element name="Actions" type="ActionsType" xdb:SQLName="ACTIONS"/>
    13                          <xs:element name="Reject" type="RejectionType" minOccurs="0" xdb:SQLName="REJECTION"/>
    14                          <xs:element name="Requestor" type="RequestorType" xdb:SQLName="REQUESTOR"/>
    15                          <xs:element name="User" type="UserType" xdb:SQLName="USERID"/>
    16                          <xs:element name="CostCenter" type="CostCenterType" xdb:SQLName="COST_CENTER"/>
    17                          <xs:element name="ShippingInstructions" type="ShippingInstructionsType" xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
    18                          <xs:element name="SpecialInstructions" type="SpecialInstructionsType" xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
    19                          <xs:element name="LineItems" type="LineItemsType" xdb:SQLName="LINEITEMS"/>
    20                  </xs:sequence>
    21          </xs:complexType>
    22          <xs:complexType name="LineItemsType" xdb:SQLType="LINEITEMS_T">
    23                  <xs:sequence>
    24                          <xs:element name="LineItem" type="LineItemType" maxOccurs="unbounded" xdb:SQLName="LINEITEM" xdb:SQLCollType="LINEITEM_V"/>
    25                  </xs:sequence>
    26          </xs:complexType>
    27          <xs:complexType name="LineItemType" xdb:SQLType="LINEITEM_T">
    28                  <xs:sequence>
    29                          <xs:element name="Description" type="DescriptionType" xdb:SQLName="DESCRIPTION"/>
    30                          <xs:element name="Part" type="PartType" xdb:SQLName="PART"/>
    31                  </xs:sequence>
    32                  <xs:attribute name="ItemNumber" type="xs:integer" xdb:SQLName="ITEMNUMBER" xdb:SQLType="NUMBER"/>
    33          </xs:complexType>
    34          <xs:complexType name="PartType" xdb:SQLType="PART_T">
    35                  <xs:attribute name="Id" xdb:SQLName="PART_NUMBER" xdb:SQLType="VARCHAR2">
    36                          <xs:simpleType>
    37                                  <xs:restriction base="xs:string">
    38                                          <xs:minLength value="10"/>
    39                                          <xs:maxLength value="14"/>
    40                                  </xs:restriction>
    41                          </xs:simpleType>
    42                  </xs:attribute>
    43                  <xs:attribute name="Quantity" type="moneyType" xdb:SQLName="QUANTITY"/>
    44                  <xs:attribute name="UnitPrice" type="quantityType" xdb:SQLName="UNITPRICE"/>
    45          </xs:complexType>
    46          <xs:simpleType name="ReferenceType">
    47                  <xs:restriction base="xs:string">
    48                          <xs:minLength value="18"/>
    49                          <xs:maxLength value="30"/>
    50                  </xs:restriction>
    51          </xs:simpleType>
    52          <xs:complexType name="ActionsType" xdb:SQLType="ACTIONS_T">
    53                  <xs:sequence>
    54                          <xs:element name="Action" maxOccurs="4" xdb:SQLName="ACTION" xdb:SQLCollType="ACTION_V">
    55                                  <xs:complexType xdb:SQLType="ACTION_T">
    56                                          <xs:sequence>
    57                                                  <xs:element name="User" type="UserType" xdb:SQLName="ACTIONED_BY"/>
    58                                                  <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_ACTIONED"/>
    59                                          </xs:sequence>
    60                                  </xs:complexType>
    61                          </xs:element>
    62                  </xs:sequence>
    63          </xs:complexType>
    64          <xs:complexType name="RejectionType" xdb:SQLType="REJECTION_T">
    65                  <xs:all>
    66                          <xs:element name="User" type="UserType" minOccurs="0" xdb:SQLName="REJECTED_BY"/>
    67                          <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_REJECTED"/>
    68                          <xs:element name="Comments" type="CommentsType" minOccurs="0" xdb:SQLName="REASON_REJECTED"/>
    69                  </xs:all>
    70          </xs:complexType>
    71          <xs:complexType name="ShippingInstructionsType" xdb:SQLType="SHIPPING_INSTRUCTIONS_T">
    72                  <xs:sequence>
    73                          <xs:element name="name" type="NameType" minOccurs="0" xdb:SQLName="SHIP_TO_NAME"/>
    74                          <xs:element name="address" type="AddressType" minOccurs="0" xdb:SQLName="SHIP_TO_ADDRESS"/>
    75                          <xs:element name="telephone" type="TelephoneType" minOccurs="0" xdb:SQLName="SHIP_TO_PHONE"/>
    76                  </xs:sequence>
    77          </xs:complexType>
    78          <xs:simpleType name="moneyType">
    79                  <xs:restriction base="xs:decimal">
    80                          <xs:fractionDigits value="2"/>
    81                          <xs:totalDigits value="12"/>
    82                  </xs:restriction>
    83          </xs:simpleType>
    84          <xs:simpleType name="quantityType">
    85                  <xs:restriction base="xs:decimal">
    86                          <xs:fractionDigits value="4"/>
    87                          <xs:totalDigits value="8"/>
    88                  </xs:restriction>
    89          </xs:simpleType>
    90          <xs:simpleType name="UserType">
    91                  <xs:restriction base="xs:string">
    92                          <xs:minLength value="1"/>
    93                          <xs:maxLength value="10"/>
    94                  </xs:restriction>
    95          </xs:simpleType>
    96          <xs:simpleType name="RequestorType">
    97                  <xs:restriction base="xs:string">
    98                          <xs:minLength value="0"/>
    99                          <xs:maxLength value="128"/>
    100                  </xs:restriction>
    101          </xs:simpleType>
    102          <xs:simpleType name="CostCenterType">
    103                  <xs:restriction base="xs:string">
    104                          <xs:minLength value="1"/>
    105                          <xs:maxLength value="4"/>
    106                  </xs:restriction>
    107          </xs:simpleType>
    108          <xs:simpleType name="VendorType">
    109                  <xs:restriction base="xs:string">
    110                          <xs:minLength value="0"/>
    111                          <xs:maxLength value="20"/>
    112                  </xs:restriction>
    113          </xs:simpleType>
    114          <xs:simpleType name="PurchaseOrderNumberType">
    115                  <xs:restriction base="xs:integer"/>
    116          </xs:simpleType>
    117          <xs:simpleType name="SpecialInstructionsType">
    118                  <xs:restriction base="xs:string">
    119                          <xs:minLength value="0"/>
    120                          <xs:maxLength value="2048"/>
    121                  </xs:restriction>
    122          </xs:simpleType>
    123          <xs:simpleType name="NameType">
    124                  <xs:restriction base="xs:string">
    125                          <xs:minLength value="1"/>
    126                          <xs:maxLength value="20"/>
    127                  </xs:restriction>
    128          </xs:simpleType>
    129          <xs:simpleType name="AddressType">
    130                  <xs:restriction base="xs:string">
    131                          <xs:minLength value="1"/>
    132                          <xs:maxLength value="256"/>
    133                  </xs:restriction>
    134          </xs:simpleType>
    135          <xs:simpleType name="TelephoneType">
    136                  <xs:restriction base="xs:string">
    137                          <xs:minLength value="1"/>
    138                          <xs:maxLength value="24"/>
    139                  </xs:restriction>
    140          </xs:simpleType>
    141          <xs:simpleType name="DateType">
    142                  <xs:restriction base="xs:date"/>
    143          </xs:simpleType>
    144          <xs:simpleType name="CommentsType">
    145                  <xs:restriction base="xs:string">
    146                          <xs:minLength value="1"/>
    147                          <xs:maxLength value="2048"/>
    148                  </xs:restriction>
    149          </xs:simpleType>
    150          <xs:simpleType name="DescriptionType">
    151                  <xs:restriction base="xs:string">
    152                          <xs:minLength value="1"/>
    153                          <xs:maxLength value="256"/>
    154                  </xs:restriction>
    155          </xs:simpleType>
    156  </xs:schema>');
    157  begin
    158          dbms_xmlschema.registerSchema( SCHEMAURL => '/xsd/purchaseOrder.xsd', SCHEMADOC => XMLSCHEMA);
    159  end;
    160  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.94
    SQL> VAR URL VARCHAR2(1024)
    SQL> VAR RESULT CLOB;
    SQL> --
    SQL> create or replace package TESTPROC
      2  as
      3    function getPurchaseOrder(P_REFERENCE VARCHAR2) return XMLTYPE;
      4    function expandWSDL return XMLTYPE;
      5  end;
      6  /
    Package created.
    Elapsed: 00:00:00.02
    SQL> --
    SQL> create or replace package body TESTPROC
      2  as
      3  --
      4  function getPurchaseOrder(P_REFERENCE VARCHAR2)
      5  return XMLType
      6  as
      7    V_RESULT XMLTYPE;
      8  begin
      9    select object_value
    10      into V_RESULT
    11      from PURCHASEORDER
    12     where XMLEXISTS('$p/PurchaseOrder[Reference=$ref]' passing P_REFERENCE as "ref");
    13    return V_RESULT;
    14  end;
    15  --
    16  function getWSDL
    17  return XMLType
    18  as
    19    V_WSDL_URL VARCHAR2(700) :=  'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC/GETPURCHASEORDER';
    20    V_WSDL     XMLTYPE;
    21  begin
    22          select httpuritype( V_WSDL_URL || '?wsdl' ).getXML()
    23            into V_WSDL
    24            from dual;
    25          return V_WSDL;
    26  end;
    27  --
    28  function expandWSDL
    29  return XMLTYPE
    30  as
    31    V_INTERNAL_URL VARCHAR2(700);
    32    V_EXTERNAL_URL VARCHAR2(700);
    33    V_NAMESPACE       VARCHAR2(4000);
    34    V_WSDL         XMLTYPE := getWSDL();
    35    V_XSD          XMLTYPE;
    36  begin
    37          -- Need to provide real logic to determine which XSD goes with which parameter...
    38
    39    -- get the TARGETNAMESPACE for the import element (Not sure how this would work with a noNamespace Schema since we'd be in Chamelian Land)
    40    select SCHEMA_URL,
    41           XMLCAST
    42           (
    43             XMLQUERY
    44             (
    45               'declare namespace xsd = "http://www.w3.org/2001/XMLSchema"; (::)
    46               $xsd/xsd:schema/@targetNamespace'
    47               passing SCHEMA as "xsd" returning content
    48             )
    49             as VARCHAR2(4000)
    50           )
    51      into V_INTERNAL_URL, V_NAMESPACE
    52            from USER_XML_SCHEMAS
    53           where SCHEMA_URL = '/xsd/purchaseOrder.xsd';
    54
    55    V_EXTERNAL_URL := '/sys/schemas/&USERNAME' || V_INTERNAL_URL;
    56
    57    -- Add  <xsd:import namespace="http://xmlns.example.com/xsd/purchaseOrder" schemaLocation="http://localhost:80/sys/schemas/WSDLTEST/xsd/purchaseOrder.xsd
    "/>
    58
    59    select insertXMLBefore
    60           (
    61              V_WSDL,
    62              '//xsd:schema/child::*[1]',
    63              xmlElement("xsd:import",xmlAttributes('http://www.w3.org/2001/XMLSchema' as "xmlns:xsd",V_NAMESPACE as "namespace",V_EXTERNAL_URL as "schemaLoc
    ation")),
    64              'xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
    65           )
    66      into V_WSDL
    67      from dual;
    68
    69    select updateXML
    70           (
    71             V_WSDL,
    72             '//xsd:schema/xsd:element[@name="GETPURCHASEORDEROutput"]/xsd:complexType/xsd:sequence/xsd:element[@name="RETURN"]/xsd:complexType',
    73             XMLElement
    74             (
    75               "xsd:complexType",
    76               XMLAttributes('http://www.w3.org/2001/XMLSchema' as "xmlns:xsd"),
    77               XMLElement
    78               (
    79                 "xsd:sequence",
    80                 XMLElement
    81                 (
    82                    "xsd:element",
    83                    xmlAttributes('http://xmlns.example.com/xsd/purchaseOrder' as "xmlns:po",'po:PurchaseOrder' as "ref")
    84                 )
    85               )
    86             ),
    87             'xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
    88           )
    89      into V_WSDL
    90      from dual;
    91
    92    return V_WSDL;
    93  end;
    94  --
    95  end;
    96  /
    old  19:   V_WSDL_URL VARCHAR2(700) :=  'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC/GETPURCHASEORDER';
    new  19:   V_WSDL_URL VARCHAR2(700) :=  'http://WSDLTEST:WSDLTEST@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER';
    old  55:   V_EXTERNAL_URL := '/sys/schemas/&USERNAME' || V_INTERNAL_URL;
    new  55:   V_EXTERNAL_URL := '/sys/schemas/WSDLTEST' || V_INTERNAL_URL;
    Package body created.
    Elapsed: 00:00:00.05
    SQL> show errors
    No errors.
    SQL> --
    SQL> BEGIN
      2    :URL := 'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC';
      3  end;
      4  /
    old   2:   :URL := 'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC';
    new   2:   :URL := 'http://WSDLTEST:WSDLTEST@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/WSDLTEST/TESTPROC';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> print url
    URL
    http://WSDLTEST:WSDLTEST@localhost:80/orawsv/WSDLTEST/TESTPROC
    SQL> --
    SQL> set long 10000000 pages 0 lines 160
    SQL> --
    SQL> select httpuritype( :URL || '?wsdl' ).getXML()
      2    from dual
      3  /
    <definitions name="TESTPROC" targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns
    .oracle.com/orawsv/WSDLTEST/TESTPROC" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      <types>
        <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC" elementFormDefault="qualified">
          <xsd:element name="CXMLTYPE-GETPURCHASEORDERInput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="P_REFERENCE-VARCHAR2-IN" type="xsd:string"/>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="GETPURCHASEORDEROutput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="RETURN">
                  <xsd:complexType>
                    <xsd:sequence>
                      <xsd:any/>
                    </xsd:sequence>
                  </xsd:complexType>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="CXMLTYPE-EXPANDWSDLInput">
            <xsd:complexType>
              <xsd:sequence>
                </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="EXPANDWSDLOutput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="RETURN">
                  <xsd:complexType>
                    <xsd:sequence>
                      <xsd:any/>
                    </xsd:sequence>
                  </xsd:complexType>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:schema>
      </types>
      <message name="GETPURCHASEORDERInputMessage">
        <part name="parameters" element="tns:CXMLTYPE-GETPURCHASEORDERInput"/>
      </message>
      <message name="GETPURCHASEORDEROutputMessage">
        <part name="parameters" element="tns:GETPURCHASEORDEROutput"/>
      </message>
      <message name="EXPANDWSDLInputMessage">
        <part name="parameters" element="tns:CXMLTYPE-EXPANDWSDLInput"/>
      </message>
      <message name="EXPANDWSDLOutputMessage">
        <part name="parameters" element="tns:EXPANDWSDLOutput"/>
      </message>
      <portType name="TESTPROCPortType">
        <operation name="GETPURCHASEORDER">
          <input message="tns:GETPURCHASEORDERInputMessage"/>
          <output message="tns:GETPURCHASEORDEROutputMessage"/>
        </operation>
        <operation name="EXPANDWSDL">
          <input message="tns:EXPANDWSDLInputMessage"/>
          <output message="tns:EXPANDWSDLOutputMessage"/>
        </operation>
      </portType>
      <binding name="TESTPROCBinding" type="tns:TESTPROCPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GETPURCHASEORDER">
          <soap:operation soapAction="GETPURCHASEORDER"/>
          <input>
            <soap:body parts="parameters" use="literal"/>
          </input>
          <output>
            <soap:body parts="parameters" use="literal"/>
          </output>
        </operation>
        <operation name="EXPANDWSDL">
          <soap:operation soapAction="EXPANDWSDL"/>
          <input>
            <soap:body parts="parameters" use="literal"/>
          </input>
          <output>
            <soap:body parts="parameters" use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="TESTPROCService">
        <documentation>Oracle Web Service</documentation>
        <port name="TESTPROCPort" binding="tns:TESTPROCBinding">
          <soap:address location="http://localhost:80/orawsv/WSDLTEST/TESTPROC"/>
        </port>
      </service>
    </definitions>
    Elapsed: 00:00:00.33
    SQL> select TESTPROC.expandWSDL()
      2    from dual
      3  /
    <definitions name="GETPURCHASEORDER" targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" xmlns="http://schemas.xmlsoap.org/wsdl/
    " xmlns:tns="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.
    org/wsdl/soap/">
      <types>
        <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" elementFormDefault="qualified">
          <xsd:import xmlns:xsd="http://www.w3.org/2001/XMLSchema" namespace="http://xmlns.example.com/xsd/purchaseOrder" schemaLocation="/sys/schemas/WSDLTEST/xsd/
    purchaseOrder.xsd"/>
          <xsd:element name="CXMLTYPE-GETPURCHASEORDERInput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="P_REFERENCE-VARCHAR2-IN" type="xsd:string"/>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="GETPURCHASEORDEROutput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="RETURN">
                  <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                    <xsd:sequence>
                      <xsd:element xmlns:po="http://xmlns.example.com/xsd/purchaseOrder" ref="po:PurchaseOrder"/>
                    </xsd:sequence>
                  </xsd:complexType>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:schema>
      </types>
      <message name="GETPURCHASEORDERInputMessage">
        <part name="parameters" element="tns:CXMLTYPE-GETPURCHASEORDERInput"/>
      </message>
      <message name="GETPURCHASEORDEROutputMessage">
        <part name="parameters" element="tns:GETPURCHASEORDEROutput"/>
      </message>
      <portType name="GETPURCHASEORDERPortType">
        <operation name="GETPURCHASEORDER">
          <input message="tns:GETPURCHASEORDERInputMessage"/>
          <output message="tns:GETPURCHASEORDEROutputMessage"/>
        </operation>
      </portType>
      <binding name="GETPURCHASEORDERBinding" type="tns:GETPURCHASEORDERPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GETPURCHASEORDER">
          <soap:operation soapAction="GETPURCHASEORDER"/>
          <input>
            <soap:body parts="parameters" use="literal"/>
          </input>
          <output>
            <soap:body parts="parameters" use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="GETPURCHASEORDERService">
        <documentation>Oracle Web Service</documentation>
        <port name="GETPURCHASEORDERPort" binding="tns:GETPURCHASEORDERBinding">
          <soap:address location="http://localhost:80/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER"/>
        </port>
      </service>
    </definitions>
    Elapsed: 00:00:00.11
    SQL> BEGIN
      2    :URL := 'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC/EXPANDWSDL';
      3  end;
      4  /
    old   2:   :URL := 'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC/EXPANDWSDL';
    new   2:   :URL := 'http://WSDLTEST:WSDLTEST@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/WSDLTEST/TESTPROC/EXPANDWSDL';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> print url
    http://WSDLTEST:WSDLTEST@localhost:80/orawsv/WSDLTEST/TESTPROC/EXPANDWSDL
    SQL> --
    SQL> set serveroutput on
    SQL> --
    SQL> VAR WSDL_TEXT CLOB
    SQL> --
    SQL> DECLARE
      2    V_SOAP_REQUEST      XMLTYPE := XMLTYPE(
      3  '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      4                      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      5                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      6                      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      7          <SOAP-ENV:Body>
      8                  <m:CXMLTYPE-EXPANDWSDLInput xmlns:m="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC"/>
      9          </SOAP-ENV:Body>
    10  </SOAP-ENV:Envelope>');
    11    V_SOAP_REQUEST_TEXT CLOB := V_SOAP_REQUEST.getClobVal();
    12    V_REQUEST           UTL_HTTP.REQ;
    13    V_RESPONSE          UTL_HTTP.RESP;
    14    V_BUFFER            VARCHAR2(1024);
    15    V_RESPONSE_TEXT     CLOB;
    16    V_RESPONSE_XML      XMLTYPE;
    17    V_WSDL              XMLTYPE;
    18  BEGIN
    19          DBMS_LOB.CREATETEMPORARY(V_RESPONSE_TEXT, TRUE);
    20
    21    begin
    22      V_REQUEST := UTL_HTTP.BEGIN_REQUEST(URL => :URL, METHOD => 'POST');
    23      UTL_HTTP.SET_HEADER(V_REQUEST, 'User-Agent', 'Mozilla/4.0');
    24      V_REQUEST.METHOD := 'POST';
    25      UTL_HTTP.SET_HEADER (R => V_REQUEST, NAME => 'Content-Length', VALUE => DBMS_LOB.GETLENGTH(V_SOAP_REQUEST_TEXT));
    26      UTL_HTTP.WRITE_TEXT (R => V_REQUEST, DATA => V_SOAP_REQUEST_TEXT);
    27      V_RESPONSE := UTL_HTTP.GET_RESPONSE(V_REQUEST);
    28       LOOP
    29        UTL_HTTP.READ_LINE(V_RESPONSE, V_BUFFER, TRUE);
    30        DBMS_LOB.WRITEAPPEND(V_RESPONSE_TEXT,LENGTH(V_BUFFER),V_BUFFER);
    31       END LOOP;
    32       UTL_HTTP.END_RESPONSE(V_RESPONSE);
    33    EXCEPTION
    34      WHEN UTL_HTTP.END_OF_BODY THEN
    35        UTL_HTTP.END_RESPONSE(V_RESPONSE);
    36    END;
    37
    38    V_RESPONSE_XML := XMLTYPE(V_RESPONSE_TEXT);
    39
    40    select XMLQUERY
    41           (
    42             'declare namespace SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; (::)
    43              declare namespace SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; (::)
    44              declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; (::)
    45              declare namespace xsd="http://www.w3.org/2001/XMLSchema"; (::)
    46              declare namespace m="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC"; (::)
    47              $resp/SOAP-ENV:Envelope/SOAP-ENV:Body/m:EXPANDWSDLOutput/m:RETURN/*'
    48              passing V_RESPONSE_XML as "resp" returning content
    49           )
    50      into V_WSDL
    51      from DUAL;
    52
    53    select V_WSDL.getClobVal()
    54      into :WSDL_TEXT
    55      from dual;
    56
    57          DBMS_LOB.FREETEMPORARY(V_RESPONSE_TEXT);
    58
    59  END;
    60  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.10
    SQL> --
    SQL> set pages 0 lines 160 long 10000
    SQL> column WSDL format A160
    SQL> --
    SQL> select xmlserialize(document XMLTYPE(:WSDL_TEXT) as CLOB indent size=2) WSDL
      2    from dual
      3  /
    <definitions name="GETPURCHASEORDER" targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" xmlns="http://schemas.xmlsoap.org/wsdl/
    " xmlns:tns="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.
    org/wsdl/soap/">
      <types>
        <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" elementFormDefault="qualified">
          <xsd:import xmlns:xsd="http://www.w3.org/2001/XMLSchema" namespace="http://xmlns.example.com/xsd/purchaseOrder" schemaLocation="/sys/schemas/WSDLTEST/xsd/
    purchaseOrder.xsd"/>
          <xsd:element name="CXMLTYPE-GETPURCHASEORDERInput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="P_REFERENCE-VARCHAR2-IN" type="xsd:string"/>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="GETPURCHASEORDEROutput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="RETURN">
                  <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                    <xsd:sequence>
                      <xsd:element xmlns:po="http://xmlns.example.com/xsd/purchaseOrder" ref="po:PurchaseOrder"/>
                    </xsd:sequence>
                  </xsd:complexType>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:schema>
      </types>
      <message name="GETPURCHASEORDERInputMessage">
        <part name="parameters" element="tns:CXMLTYPE-GETPURCHASEORDERInput"/>
      </message>
      <message name="GETPURCHASEORDEROutputMessage">
        <part name="parameters" element="tns:GETPURCHASEORDEROutput"/>
      </message>
      <portType name="GETPURCHASEORDERPortType">
        <operation name="GETPURCHASEORDER">
          <input message="tns:GETPURCHASEORDERInputMessage"/>
          <output message="tns:GETPURCHASEORDEROutputMessage"/>
        </operation>
      </portType>
      <binding name="GETPURCHASEORDERBinding" type="tns:GETPURCHASEORDERPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GETPURCHASEORDER">
          <soap:operation soapAction="GETPURCHASEORDER"/>
          <input>
            <soap:body parts="parameters" use="literal"/>
          </input>
          <output>
            <soap:body parts="parameters" use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="GETPURCHASEORDERService">
        <documentation>Oracle Web Service</documentation>
        <port name="GETPURCHASEORDERPort" binding="tns:GETPURCHASEORDERBinding">
          <soap:address location="http://localhost:80/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER"/>
        </port>
      </service>
    </definitions>
    Elapsed: 00:00:00.03
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    C:\xdb\examples\DBNWS>

  • [UIX] How To: Return multiple values from a LOV

    Hi gang
    I've been receiving a number of queries via email on how to return multiple items from a LOV using UIX thanks to earlier posts of mine on OTN. I'm unfortunately aware my previous posts on this are not that clear thanks to the nature of the forums Q&A type approach. So I thought I'd write one clear post, and then direct any queries to it from now on to save me time.
    Following is my solution to this problem. Please note it's just one method of many in skinning a cat. It's my understanding via chatting to Oracle employees that LOVs are to be changed in a future release of JDeveloper to be more like Oracle Forms LOVs, so my skinning skills may be rather bloody & crude very soon (already?).
    I'll base my example on the hr schema supplied with the standard RDBMS install.
    Say we have an UIX input-form screen to modify an employees record. The employees record has a department_id field and a fk to the departments table. Our requirement is to build a LOV for the department_id field such that we can link the employees record to any department_id in the database. In turn we want the department_name shown on the employees input form, so this must be returned via the LOV too.
    To meet this requirement follow these steps:
    1) In your ADF BC model project, create 2 EOs for employees and departments.
    2) Also in your model, create 2 VOs for the same EOs.
    3) Open your employees VO and create a new attribute DepartmentName. Check “selected in query”. In expressions type “(SELECT dept.department_name FROM departments dept WHERE dept.department_id = employees.department_id)”. Check Updateable “always”.
    4) Create a new empty UIX page in your ViewController project called editEmployees.uix.
    5) From the data control palette, drag and drop EmployeesView1 as an input-form. Notice that the new field DepartmentName is also included in the input-form.
    6) As the DepartmentName will be populated either from querying existing employees records, or via the LOV, disable the field as the user should not have the ability to edit it.
    7) Select the DepartmentId field and delete it. In the UI Model window delete the DepartmentId binding.
    8) From the data controls palette, drag and drop the DepartmentId field as a messageLovInput onto your page. Note in your application navigator a new UIX page lovWindow0.uix (or similar) has been created for you.
    9) While the lovWindow0.uix is still in italics (before you save it), rename the file to departmentsLov.uix.
    10) Back in your editEmployees.uix page, your messageLovInput source will look like the following:
    <messageLovInput
        model="${bindings.DepartmentId}"
        id="${bindings.DepartmentId.path}"
        destination="lovWindow0.uix"/>Change it to be:
    <messageLovInput
        model="${bindings.DepartmentId}"
        id="DepartmentId"
        destination="departmentsLov.uix"
        partialRenderMode="multiple"
        partialTargets="_uixState DepartmentName"/>11) Also change your DepartmentName source to look like the following:
    <messageTextInput
        id=”DepartmentName”
        model="${bindings.DepartmentName}"
        columns="10"
        disabled="true"/>12) Open your departmentsLov.uix page.
    13) In the data control palette, drag and drop the DepartmentId field of the DepartmentView1 as a LovTable into the Results area on your page.
    14) Notice in the UI Model window that the 3 binding controls have been created for you, an iterator, a range and a binding for DepartmentId.
    15) Right click on the DepartmentsLovUIModel node in the UI Model window, then create binding, display, and finally attribute. The attribute binding editor will pop up. In the select-an-iterator drop down select the DepartmentsView1Iterator. Now select DepartmentName in the attribute list and then the ok button.
    16) Note in the UI Model you now have a new binding called DCDefaultControl. Select this, and in the property palette change the Id to DepartmentName.
    17) View the LOV page’s source, and change the lovUpdate event as follows:
    <event name="lovSelect">
        <compound>
            <set value="${bindings.DepartmentId.inputValue}" target="${sessionScope}" property="MyAppDepartmentId" />
            <set value="${bindings.DepartmentName.inputValue}" target="${sessionScope}" property="MyAppDepartmentName" />
        </compound>
    </event>18) Return to editEmployees.uix source, and modify the lovUpdate event to look as follows:
    <event name="lovUpdate">
        <compound>
            <set value="${sessionScope.MyAppDepartmentId}" target="${bindings.DepartmentId}" property="inputValue"/>
            <set value="${sessionScope.MyAppDepartmentName}" target="${bindings.DepartmentName}" property="inputValue"/>     
        </compound>
    </event>That’s it. Now when you select a value in your LOV, it will return 2 (multiple!) values.
    A couple things to note:
    1) In the messageLovInput id field we don’t use the “.path” notation. This is mechanism for returning 1 value from the LOV and is useless for us.
    2) Again in the messageLovInput we supply “_uixState” as an entry in the partialTargets.
    3) We are relying on partial-page-refresh functionality to update multiple items on the screen.
    I’m not going to take the time out to explain these 3 points, but it’s worthwhile you learning more about them, especially the last 2, as a separate exercise.
    One other useful thing to do is, in your messageLovInput, include as a last entry in the partialTargets list “MessageBox”. In turn locate the messageBox control on your page (if any), and supply an id=”MessageBox”. This will allow the LOV to place any errors raised in the MessageBox and show them to the user.
    I hope this works for you :)
    Cheers,
    CM.

    Thanks Chris,
    It took me some time to find the information I needed, how to use return multiple values from a LOV popup window, then I found your post and all problems were solved. Its working perfectly, well, almost perfectly.
    Im always fighting with ADF-UIX, it never does the thing that I expect it to do, I guess its because I have a hard time letting go of the total control you have as a developer and let the framework take care of a few things.
    Anyway, I'm using your example to fill 5 fields at once, one of the fields being a messageChoice (a list with countries) with a LOV to a lookup table (id , country).
    I return the countryId from the popup LOV window, that works great, but it doesn't set the correct value in my messageChoice . I think its because its using the CountryId for the listbox index.
    So how can I select the correct value inside my messageChoice? Come to think of it, I dont realy think its LOV related...
    Can someone help me out out here?
    Kind regards
    Ido

  • SQL Command returns multiple records, but I see only one record in report

    I work with Crystal Reports XI R2 SP3 and Oracle 10g R2 database.
    I have an SQL Command that returns multiple records. Command name is "CommDivisionNames" and it returns column "CommDivisionNames.DIVISION_NAME". When I place this field into report details section of the report, I can see all 10 records returned and this is how it should be. I actually need this field to be placed in the report header section, and when I place the field there, then I see only the first record. I set that field as "can grow = true". When I do "browse field data" for this field, I see that all 10 records are there, but only the first one is displayed in report header section.
    I thought that I can place SQL Command field anywhere on the report (page header, footer, details) and that it will always show all records that it returns from the database. Can that be done?
    My "main part" of the report returns different set of records, and that's what I have in "report details" section. I need this list of divisions to be in the report header section, so user can see that the report was executed for DivA, DivC, DivE.
    Thank you,
    Milan

    sharonamt:
    Users select divisions from parameter, but the parameter multi values are division_numbers (1,5,10), not division_names. Division_names are visible in parameter_prompt_window as description, but parameter remembers only numbers and I don't know how I can reuse division_names later in formula.
    I do join for division_numbers and make them into one string variable and pass to sub-report, but I think that I can only get these division_names by calling an SQL command or calling stored procedure.
    If I try to do join({MySQLcommand.DIVISION_NAME}) I get error message "A string array is required here".
    Carl:
    I'm playing with cross-tab and I can use it to see all division_names in the report-header section. Since I need them in only one column or only one row, I have to edit cross-tab object and turn all unneeded border lines to white to make them look invisible. So, cross-tab could be a solution for my problem here.
    Another option could be to re-write my SQL command. Since I've read here that SQL command could be written in the same way as I would write a stored procedure, then I could use a bit more complex code to get all multiple division names from the database table into a local cursor, and then use do-while loop to concatenate them into one string, and then to return that string as one record (like 'DivA, DivB, DivC'), and then it should not be a problem to display only that one record/string in report header. It is my understanding that Crystal Reports can call stored procedure that works with many cursors/recordsets and CR will use only the last recordset from the stored procedure. Do you think it could be done this way?
    Thank you,
    Milan

  • How to pass multiple records to target side using xquery

    Hi Everybody,
    I am using xquery transformation.
    Input: Source payload contains 5 variables.
    Target payload contains 5 variables.
    I have input with payload with multiple instance like:
    <Input>
    <payload1>
    <a>1<a>
    <b>2<b>
    <c>3<c>
    <d>4<d>
    <e>5<e>
    </payload1>
    <payload1>
    <a>6<a>
    <b>7<b>
    <c>8<c>
    <d>9<d>
    <e>10<e>
    </payload1>
    </Input>
    So my requirement is to pass above records into target side,
    So I am using xquery Transformation.
    I have written code as follows.
    (:: pragma bea:global-element-parameter parameter="$tHRecAdv1" element="ns0:THRecAdv" location="../XMLSchemas/THRecAdv.xsd" ::)
    (:: pragma bea:global-element-return element="ns1:ShipmentReceiptEBO" location="../../AIAReferenceModelProject/EnterpriseObjectLibrary/Core/EBO/ShipmentReceipt/V1/ShipmentReceiptEBO.xsd" ::)
    declare namespace ns2 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/EBO/ShipmentReceipt/V1";
    declare namespace ns1 = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/ShipmentReceipt/V1";
    declare namespace ns4 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2";
    declare namespace ns3 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/Common/V2";
    declare namespace ns0 = "http://diversey.com/THRecAdv";
    declare namespace xf = "http://tempuri.org/ShipmentReceiptServicesProject/XMLTransformations/THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery/";
    declare function xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1 as element(ns0:THRecAdv))
    as element(ns1:ShipmentReceiptEBO) {
    for $THRecAdvFields  in $tHRecAdv1/ns0:THRecAdvFields
    return
    <ns1:ShipmentReceiptEBO>
    <ns4:Identification>
    <ns4:BusinessComponentID>{ data($THRecAdvFields/ns0:JD_WHSE_Code) }</ns4:BusinessComponentID>
    <ns4:ID schemeID = "{ (data($THRecAdvFields/ns0:JD_PO_Number)) }"
    schemeVersionID = "{ data($THRecAdvFields/ns0:JD_PO_Type) }">{ data($THRecAdvFields/ns0:WMS_InternalPONumber) }</ns4:ID>
    <ns4:ApplicationObjectKey>
    <ns4:ID>{ data($THRecAdvFields/ns0:JD_BranchPlant) }</ns4:ID>
    </ns4:ApplicationObjectKey>
    <ns4:Revision>
    <ns4:Reason>{ data($THRecAdvFields/ns0:ReturnReceiptReasonCode) }</ns4:Reason>
    </ns4:Revision>
    </ns4:Identification>
    <ns1:ExpectedReceiptDate>{ data($THRecAdvFields/ns0:WMS_ReceiptDate) }</ns1:ExpectedReceiptDate>
    <ns4:InvoiceReference>
    <ns4:InvoiceIdentification>
    <ns4:ID>{ data($THRecAdvFields/ns0:JDE_SupplierInvoiceNumber) }</ns4:ID>
    </ns4:InvoiceIdentification>
    </ns4:InvoiceReference>
    <ns1:ShipmentReceiptLine actionCode = "{ data($THRecAdvFields/ns0:ActionFlag) }">
    <ns4:Identification>
    <ns4:ID schemeID = "{ data($THRecAdvFields/ns0:JD_PO_LineNumber) }"
    schemeVersionID = "{ data($THRecAdvFields/ns0:ExternPONumber) }">{ data($THRecAdvFields/ns0:WMS_ReceiptNumber) }</ns4:ID>
    <ns4:ContextID>{ data($THRecAdvFields/ns0:WMSReceivingClerk) }</ns4:ContextID>
    <ns4:ApplicationObjectKey>
    <ns4:ID schemeID = "{ data($THRecAdvFields/ns0:BatchNumber) }"
    schemeVersionID = "{ data($THRecAdvFields/ns0:BatchLineNumber) }">{ data($THRecAdvFields/ns0:JD_LocationCode) }</ns4:ID>
    </ns4:ApplicationObjectKey>
    <ns4:AlternateObjectKey>
    <ns4:ID>{ data($THRecAdvFields/ns0:SupplierCode) }</ns4:ID>
    <ns4:ContextID>{ data($THRecAdvFields/ns0:LineNumber_Or_SequenceNumber) }</ns4:ContextID>
    </ns4:AlternateObjectKey>
    <ns4:Revision>
    <ns4:Label>{ data($THRecAdvFields/ns0:Records) }</ns4:Label>
    </ns4:Revision>
    </ns4:Identification>
    <ns1:ReceivedQuantity unitCode = "{ data($THRecAdvFields/ns0:ReceiptUOM) }">{ data($THRecAdvFields/ns0:UnitReceipt) }</ns1:ReceivedQuantity>
    <ns1:SourceDocumentTypeCode>{ data($THRecAdvFields/ns0:SKU_Code) }</ns1:SourceDocumentTypeCode>
    <ns1:DestinationTypeCode>{ data($THRecAdvFields/ns0:DestinationProcessFlag) }</ns1:DestinationTypeCode>
    <ns1:Comment>{ data($THRecAdvFields/ns0:Remarks) }</ns1:Comment>
    <ns4:Status>
    <ns4:Code>{ data($THRecAdvFields/ns0:ProcessSourceFlag) }</ns4:Code>
    <ns4:EffectiveDateTime>{ data($THRecAdvFields/ns0:ADDDATE) }</ns4:EffectiveDateTime>
    </ns4:Status>
    <ns1:ShipmentReceiptTransaction>
    <ns1:ShipmentReceiptTransactionLot>
    <ns1:ShipmentReceiptItemLotReference>
    <ns1:ExpirationDate>{ data($THRecAdvFields/ns0:ExpiryDate) }</ns1:ExpirationDate>
    <ns1:CreationDateTime>{ data($THRecAdvFields/ns0:ProductionDate) }</ns1:CreationDateTime>
    </ns1:ShipmentReceiptItemLotReference>
    </ns1:ShipmentReceiptTransactionLot>
    </ns1:ShipmentReceiptTransaction>
    </ns1:ShipmentReceiptLine>
    </ns1:ShipmentReceiptEBO>
    declare variable $tHRecAdv1 as element(ns0:THRecAdv) external;
    xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1)
    But while importing this code to OSB,and tested it ,
    With 1 payload it successfully shows the data in Target side,
    But while testing with multiple line items,i am getting an error as follows.
    *Error executing the XQuery transformation: line 14, column 17: {err}FORG0005: expected exactly one item, got 2+ items*
    So please provide me the steps how to pass multiple records to target side using xquery.
    Regards,
    Jyoti Nayak

    Hi Jyoti Nayak,
    You have to do something like the example bellow, you can not just repeat the inner element, you will need an outer "container" tag. So you will have to change the target element of your xq transformation.
    declare function xf:setToList($set1 as element(ns0:set))
    as element(ns0:list) {
    <ns0:list>
    for $pair in $set1/ns0:pair
    return
    <ns0:entry>
    <ns0:key>{ data($pair/ns0:key) }</ns0:key>
    <ns0:value>{ data($pair/ns0:value) }</ns0:value>
    </ns0:entry>
    </ns0:list>
    Cheers,
    Vlad
    Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question. If you think this is helpful, please consider giving points

Maybe you are looking for

  • IPhone SDK 2.2 memory corruption

    Hello. I'm working on an application for iPhone SDK 2.2 and seem to be having weird memory corruption problems. Not necessarily leaks because using Instruments shows my memory stamp never going above about 1.8 megs. The nature of the app is a databas

  • RPM - find authorizations for item in ABAP

    Hi Experts, I have an issue. I am italian and I am not very good on writing in english, I am sorry for this. I must hide a field (STATUS for item dashboard) for some users (tab. Authorizations). I have write my code in class /RPM/OBJECT_SERVICES, met

  • Printing from Crystal Report Viewer in Powerbuilder

    I have a Crystal Report Viewer Control placed on a Powerbuilder window. I have my own Print button placed on the window. The code I have in the clicked event of this button is as follows g_ole_crx_report.PrintOut(True,1,False) This code displays a Pr

  • Other option for SubQuery...

    Hi All I want to Use other option for Subquery for Performance Tunning. Any Other way for this? Thanx in Advance

  • Materialized views queries

    Hi , if i am correct , Materialized Views will create a table of exactly the same name as per the MV. Will the so called "Table" be indexed ? and if not can i put indexes on it ? and will there be performance issue if i were to specify indexes on MV