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;

Similar Messages

  • 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

  • How can IWD_VALUE_HELP return multiple values, instead of one

    Hello expert,
    I have requirement to use F4 help to return multiple values to the using WD component. Basically in my main WD component, I have a View where I have a list box, this list box has a F4 assigned to it, clicking on the F4 brings up hte F4 help, in the F4 help, user can select multiple values which should be returned to my main component / view to be displayed in the list box.
    I'd implement IWD_VALUE_HELP to create my own F4 help component. However I have difficulty to return multiple values. As I understand there is only way to return data from F4 help to the calling Main WD component / view:
    Item_LISTENER->F4_CONTEXT_ELEMENT->set_attribute( name = 'MYATTRName' value = myvalue).
    Do you guys know how to archive what is required here?
    Thanks
    Jayson

    Hello Jayson,
    the element reference that is passed into the IWD_VALUE_HELP implementing component is the element of the calling application's context.
    Therefore you can use methods like
    IF_WD_CONTEXT_ELEMENT->GET_NODE
    (to get the parent node of the element) and 
    IF_WD_CONTEXT_ELEMENT->GET_CHILD_NODE
    to get access to other parts of the context.
    say for example your value help should populate a pop-in table with multiple entries.
    your application allows you to choose a type of ice-cream cone and then to choose the flavour of ice-cream (multi selection)has a structure like:
    Context_root
    --> List_of_ice_creams (0..n)
    >Ice_cream_flavours(1..n)
    In the element of list_of_ice_creams you have an attribute "flavour" which links to your value help.
    Choosing this value-help should allow you to select multiple flavours, return these and populate them into the sub-node Ice_cream_flavours.
    Within your custom value help you can get a reference to the node Ice_cream_flavours by calling the method
    lo_flavour_node = IItem_LISTENER->F4_CONTEXT_ELEMENT->GET_CHILD_NODE("ICE_CREAM_FLAVOURS"). You could then populate this in you value help component.
    As I mentioned - this isn't great as it means the value help cannot really be used elsewhere as it has a dependency on the structure of the calling context. But that may not be an issue for you.
    Hope that helps,
    Chris

  • 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

  • I have a large number of photos imported into iPhoto with the dates wrong.  How can I adjust multiple photos (with varying dates) to the same, correct, date?

    I have a large number of photos imported into iPhoto with the dates wrong.  How can I adjust multiple photos (with varying dates) to the same, correct, date?

    If I understand you correctly, when you enter a date in the Adjust Date and Time window, the picture does not update with the date you enter.  If that is the case then something is wrong with iPhoto or your perhaps your library.
    How large a date change are you putting in?  iPhoto currently has an issue with date changes beyond about 60 years at a time.  If the difference between the current date on the image and the date you are entering is beyond that range that may explain why this is not working.
    If that is not the case:
    Remove the following to the trash and restart the computer and try again:
    Home > Library > Caches > com.apple.iphoto
    Home > Library > Preferences > com.apple.iPhoto (There may be more than one. Remove them all.)
    ---NOTE: to get to the "home > library" hold down option on the keyboard and click on "Go" > "Library" while in the Finder.
    Let me know the results.

  • How can I copy multiple slides with a HP Scanjet 4050 to photoes using Maverick? HP apparently no longer supports this product for this OS.

    How can I copy multiple slides with a HP Scanjet 4050 to photoes using Maverick? HP apparently no longer supports this product for OS Maverick.

    VueScan
    VueScan FAQ

  • How can I edit multiple clips with different frame rates on the same timeline

    how can I edit multiple clips with different frame rates on the same timeline

    You do not want to edit material from different frame rates on one timeline. You CAN do this, but it is a very bad idea - and this is why.
    Once you establish the sequence frame rate - lets say it is PAL material at 25fps, any material that you drop into the sequence other than 25 fps will have to be changed to play at 25 fps. If the material you add is NTSC (29.97), FCP will DROP 5 frames per sec to bring the frame rate down to 25 fps. Which 5 get thrown away? Every 6th one. This yields a funky cadence that becomes even more complex as as there are also interlaced fields (DV/NTSC is an interlaced format). Oh, and by the way, the image sizes are different as well. DV/PAL has 576 lines of resolution and DV/NTSC has 480. FCP has to scale up the NTSC to fit the PAL frame.
    You do not want FCP adjusting these things on the fly. You want to do a thoughtful (and time consuming) conversion so that you end up with all your material in one format with the best possible image from the conversion process. Compressor can do an adequate job with Frame Controls turned on. The Natress Standards Conversion FCP plugin is another way to go. A third option is to find a post house that can do the conversion for you using a hardware based process.
    The good news is, once everything is in the same format, editing it will be painless and the output process very quick.
    Whatever frame rate/ image size you select, I'd suggest using ProRes for the codec. It is 4:2:2 color and will withstand color correction and composting with much more grace than any variant of DV based codecs.
    Have fun.
    x

  • How can I replace column value with a particular value in SQL

    Hi All,
    Can anyone please tell me how can I format my output with replacing a column value with a specific value which actually depends on the present value of the column
    I am executing the following SQL statement
    select state,count(id) from <table_name> where composite_dn= <composite_dn_name> group by state;
    My Present output is:
    State No.Of Instance
    1 3
    3 28
    I want to replace the value in the column state as follows
    State No.OfInstances
    Completed 3
    Faulted 28
    I want "1" to be reppaced by "Completed" and "3" to be replaced by "Faulted"
    Is is possible with SQL or PL/SQL , if it is then how can I achieve this required result. Please help!!
    Thanks in Advance!!
    Edited by: Roshni Shankar on Oct 27, 2012 12:38 AM

    Hi Roshni,
    I guess this CASE clause can be simulated by a DECODE and also it is very easy to use.
    Refer -- http://www.techonthenet.com/oracle/functions/decode.php
    select decode(t1.state,t2.state_id,t2.state_name), t1.count_id
    from <table_2> t2, (select state,count(id) count_id
    from <table_name>
    where composite_dn= <composite_dn_name>
    group by state) t1
    where t1.state = t2.state_id;HTH
    Ranit B.
    Edited by: ranit B on Oct 27, 2012 2:02 PM
    -- link added
    Edited by: ranit B on Oct 27, 2012 2:19 PM
    -- sample code added

  • How can I compare single value with multiple value...

    Hello,
    I want to compare one value with multiple values, how can it possible ?
    Here in attachment I tried to design same logic but I got problem that when I entered value in y that is compared with only minimum value of x, I don't want that I want to compare y value with all the x value and then if y is less then x while loop should be stop.
    I want to do so because in my program some time I didn't get result what I want, for example x values is 4,5,6,7,8  and y value is  suppose 6 then while loop should be stop but here it consider only minimum number and its 4 here so while loop is not stop even y is less then 7 and 8. So I want to compare y value with all the entered values of x and if y is less then any of x values then while loop should be stop and led should be ON.
    Please guide me how can I do so.....
    Solved!
    Go to Solution.
    Attachments:
    COMPARISON.vi ‏8 KB

    AnkitRamani wrote:
    Thank you very mach for your help..
    may be i have solved this ....i have made one change in my vi that instead of min. i select max and max. value is compare with the value of y and then if y is less then the max. while loop will be stop other wise its run continuously.
    this is working fine...
    any ways thanks again for your help and time...
    I have to agree with Lewis - his way is more efficient.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • F4IF_INT_TABLE_VALUE_REQUEST - how can I return all values from the line?

    Hi,
    I'm using FM F4IF_INT_TABLE_VALUE_REQUEST to show a pop-up with my internal table values.  The internal table has 3 fields, ATINN, ATZHL and a description field ATWTB.  ATINN and ATZHL are needed to complete the unique table key, however this FM will only return the value of one field in any line I select.
    How can I see all the values in the line I select in the return table?
    My code is as follows:
      DATA: tbl_cawnt LIKE cawnt OCCURS 0,
            wa_cawnt LIKE cawnt,
            BEGIN OF tbl_list OCCURS 0,
              atinn LIKE cawnt-atinn,
              atzhl LIKE cawnt-atzhl,
              atwtb LIKE cawnt-atwtb,
            END OF tbl_list,
            wa_list LIKE tbl_list,
            tbl_return LIKE ddshretval OCCURS 0,
            wa_return LIKE ddshretval,
            tbl_fields LIKE dfies OCCURS 0,
            tbl_dynp LIKE dselc OCCURS 0.
      REFRESH: tbl_list, tbl_cawnt.
      SELECT atinn atzhl atwtb
        FROM cawnt
        INTO CORRESPONDING FIELDS OF TABLE tbl_cawnt
        WHERE spras EQ sy-langu.
      LOOP AT tbl_cawnt INTO wa_cawnt.
        CLEAR wa_list.
        MOVE: wa_cawnt-atwtb TO wa_list-atwtb,
              wa_cawnt-atinn TO wa_list-atinn,
              wa_cawnt-atzhl TO wa_list-atzhl.
        APPEND wa_list TO tbl_list.
      ENDLOOP.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'ATWTB'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          value_org       = 'S'
        TABLES
          value_tab       = tbl_list
          return_tab      = tbl_return
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Thanks!

    Hi,
      Use the structure DYNPFLD_MAPPING
    With this internal table you can easily define that you want to return
    other columns of the hit list in addition to field RETFIELD to the
    screen.
    In this IT you can MAP the screen fields to the serch help screen fields this has three fields
    FLDNAME this is the field anme from the search help
    FLDINH This has to be blank which would be field with the field value that you want to map
    DYFLDNAME THis is the screen field name.
    So here you can get the values for the other fields that you want which are on the search help just populate the name of the fields in FLDNAME.
    Regards,
    Himanshu

  • How to search for multiple values with Bex Prompts

    Hi,
    I would like to know  if it is possible to search for multiple values at the same time with Bex Prompts instead of searching one value at a time (please see the screen shot below). I searched the forum couldn't find any relevant answers. please let me know  how  to achieve?
    Thanks,
    Charvi.

    Hi Charvi,
    You can use wild card search to ensure you get multiple similar values listed as search output.use * for multiple characters and ? for single character.
    For Example, Ravi * would result you all employees with first name as Ravi
    You can use various search formats such as * Ravi * and * Ravi and Ra?? etc.
    Thanks
    Mallik

  • How can I make multiple quizzes with their own results slides within one project of Captivate 7?

    In one Captivate 7 project I want to create multiple quizzes with their own results slide. 
    Currently I have 5 quizzes that all are linked to 1 results slide.
    Is there a way to give each set of questions their own results slide?
    (I saw a response to a similar question for Captivate 5 from 2012, but I couldn't get much use out of is and I figured there was an easier way in Captivate 7).
    Any help would be appreciated!
    Thanks!

    Thanks for the reply Lilybiri!
    I checked out the link and it's useful, however your other plan might work better for me:
    Either you link to separate CP-files that have each their quiz, or you can show intermediate results slides (see link below), but you have to know that the score that will be transmitted to a LMS is the total score of all the quizzes.
    But how exactly do I link separate CP-files?  Do I have to publish them first and then link them, or can I link them before I publish?
    If you could shoot me a link or some advice I'd greatly appreciate it.  I'm finishing up a huge project that is due at the end of the day and this quiz issue is one of the last things keeping me from being finished.
    Thanks!

  • How can i select multiple values form select list

    Hi ,
    I have created few items in a page and all items are Lov items and based on these items stacked charts will display. My requirement is I need to select multiple values form LOV's
    Eg: In Interactive report goto filter and select an item and expression as IN and select multiple items and i need to select multiple values like this.
    Please anybody help me how to get multiple values.
    I have one more doubt Can we have a Print preview option in APEX.
    I have to see print preview for stacked charts. is it possible?
    Regards
    Narender B

    HI ,
    Thank you for valuable information and looks good.but Here our client need to select multiple values.... for eg: Open IR report and click on Actions button --->select filter
    select any column , operator as IN and from expression select multiple items.
    I need to select multiple values in that way so, could you please guide me how can i achieve this.
    Regards
    Narender B

  • How can I return some values from an applet invoked by jsp:plugin tag

    My JSP is something like that:
    <html>
         <head>
                 <title> . . . </title>
         </head>
         <script>
              function getValueFromApplet()
                   var src = document.pinApplet.checkPin();
                   document.myForm.j_username.value = document.pinApplet.tokenizeName(src);
                   alert(document.myForm.j_username.value);
                   document.myForm.j_password.value = document.pinApplet.tokenizePassword(src);
                   alert(document.myForm.j_password.value);
         </script>
            <body>
                    <jsp:plugin type="applet"
                          code="PinApplet.class"
                       codebase="/idp"
                       name="pinApplet"
                                width="300"
                                height="300">
                         <jsp:fallback> Authentication Form is not supported by the browser </jsp:fallback>
              </jsp:plugin>
                    <form action="https://xxx.xxx.xxx"
                   name="myForm"
                   method="post" onSubmit="return getValueFromApplet()">
              <table>
                   <td><input type="submit" value="OK" >
                   <td><input type="hidden" id="j_username" name="j_username" value=""></td>
                   <td><input type="hidden" id="j_password" name="j_password" value=""></td>
              </table>
              </form>
         </body>checkPin() returns "alice--alice"
    tokenizeName() returns the first token: alice
    tokenizePassword() returns the second token: alice
    When I test the applet in the IDE, it returns the values properly, but not in the JSP invokation.

    evnafets wrote:
    javascript will not be executing on the server. You can rule that one out.
    Is your Applet being initialised correctly?
    Where have you got the classes for it? I think the applet doesn't need any kind of initialization, because it doesn't have any variables and all the process is made in the method called by onsubmit()
    The applet is composed only by one class and I'm totally sure that the class is placed in the correct place.
    evnafets wrote:
    I would say put in a couple more alerts - one before the call to the applet, one after.
    put some logging statements in your applet to see if it gets there.In the javascript, there are two alerts between the three calls to the applet. Where do you advise me to put more alerts?
    I don't understand what do you refer when you say "logging statements"
    I am going to test again the call to the applet in order to find some kind of code that can be invalid or that can make the function to "crash"

  • How can i pass multiple values by a single variable to EXECUTE IMMEDIATE

    Hi All,
    I want to pass multiple values for where condition for execute immediate. Something Like this:-
    bold
    Declare
    v_cond varchar(1000);
    Begin
    v_cond := '''INR','USD'''; --(OPTION 1)
    v_cond := 'INR,USD'; --(OPTION 2)
    EXECUTE IMMEDIATE 'Delete from table where colm in (:v_cond)' using v_cond;
    END;
    bold
    I am using this into a procedure
    Now option 1 gives an error ie a syntax error (; expected or something like that)(I am sorry, i can't tell the exact error here as i am not in the office right now)
    and option 2 makes the procedure execute but obviously doesn't delete the records, as it takes the whole as one.
    Please Help
    Regards
    Neeraj Bansal

    See the links containing examples under
    *7. List of values in an IN clause?*
    SQL and PL/SQL FAQ
    from the SQL and PL/SQL FAQ.

Maybe you are looking for

  • Need to specify which is defuault selected button

    I have a DVD with a main feature and a more features links on the first page. Currently, the more features link is initially selected when you play the DVD, but I need the main feature to be selected - any idea how I can do this?

  • Userfield-Values in Order Recommendation Report lost after update

    Hi together, i've got a problem in the Order Recommendation Report. i've add 3 udf's in the matrix. The problem appears when I update the report. All the values in the userfields are cleared. Can anyone help me to find a solution? Do I have to custom

  • Custom Cell Renderer and JTable

    Hello all, here is what i am trying to do. i want that when a user clicks on a cell the color of the cell should change to say red. when the user clicks on the other cell the red color in the first cell should remain. the way i am trying do to this i

  • STXH_Table?

    Hi How do we maintain texts in the table STXH (STXD SAPscript text file header)? Thanks

  • Jbuttons in JTree

    Hello Guys! I have got a problem I have got a JTree with JButtons but only the childs are Buttons, pleas can you help me that the parents are also JButtons. package com.cbm.vis.util; import java.awt.*; import java.util.*; import javax.swing.*; import