How do I get multiple return results from a function

IDBASKET IDSTAGE DTSTAGE
3 1 24-JAN-03
3 5 25-JAN-03
4 1 13-FEB-03
4 5 13-FEB-03
5 3 21-FEB-03
I input is a single IDBASKET number from this table and this function works fine only if it has one IDSTAGE per idbasket. (idbasket#5)
But how do I get it to return a result for an IDBASKET when it has multiple IDSTAGE? (idbasket#3 & 4)
THANKS MUCH,
MAT
SQL> CREATE OR REPLACE FUNCTION status_desc_sf
2 (p_code NUMBER)
3 RETURN VARCHAR2
4 IS
5 lv_output_txt VARCHAR2(30);
6 BEGIN
7 IF p_code = 1 THEN lv_output_txt := 'Order submitted';
8 ELSIF p_code = 2 THEN lv_output_txt := 'Accepted, sent to shipping';
9 ELSIF p_code = 3 THEN lv_output_txt := 'Backordered';
10 ELSIF p_code = 4 THEN lv_output_txt := 'Cancelled';
11 ELSIF p_code = 5 THEN lv_output_txt := 'Shipped';
12 ELSE lv_output_txt := 'No information';
13 END IF;
14 RETURN lv_output_txt;
15 END;
16 /

Duplicate thread:
How do I get multiple return results from a function

Similar Messages

  • How do I get the return value from an executable?

    I'm running an external executable from dbms_scheduler but how do I get the exit code from the program run or any screen output?

    Hi,
    In the additional_info column of schedulerjob_run_details there should be something like
    job of type EXECUTABLE failed with exit code: Operation not permitted
    "Operation not permitted" is the error code (as translated by the errors header file for that platform).
    In releases 10.2 and up there may also be a line in the additional_info
    STANDARD_ERROR="Error text here"
    This gives the standard error messages output by the application. There is no way to get the standard output of the application.
    Hope this helps,
    Ravi.

  • How do I get the returned cursor from a stored procedure to an asp.

    Sorry if this topic has been answered before but I am new to Oracle and ASP. I have been asked to create some stored procedures and access the results from the ASP. I will be passing one variable in and could be getting upto 200 rows returned.
    I have no trouble with the stored procedure but have no clue how to retrieve the data returned by it.

    Assuming that the stored procedure has a single argument, an OUT cursor, you should be able to do
    SQLExecDirect
    {call <stored_proc>() }
    SQLFetch
    SQLGetData
    We'll handle all the 'magic' underneath.
    Justin Cave
    ODBC Development

  • How does BerkeleyDB know when cached results from stat function are valid ?

    Something curious: I have a berkeley database about 2G in size and a program that (1) opens the database, not DB_RDONLY; (2) calls stat(), without DB_FAST_STAT; (3) calls sync(); (4) calls close().
    Running this program the first time takes a good amount of time in the stat() function - 20 minutes at least - and thrashes the disk all that time. So it's trawling the database to get record counts etc.
    Running the program again takes only a few seconds so clearly the database is caching those stats and knows they're up to date - makes sense.
    What's odd though is why the stats weren't known to be up to date on the first run. The database was actually copied from another box where the last thing to happen was a run of the same program. So it should have had up-to-date stats cached in it.
    It's as if the cached values are somehow invalidated by moving the database to another machine. Why would that happen ? Where are the cached stats held and how does berekelyDB decide when they're up to date ?

    I still cannot solve this problem, but I have some more observations:
    1) yes it is a JApplet, and yes, the data streaming is performed in a separate thread.
    2) Wireshark sniffing shows that data sent out by the PHP datasource on the server is sent immediately, and is not buffered (am using ob_start(), ob_flush() and flush() alls in the PHP script).
    3) On Windows Vista, using Internet Explorer or Firefox, there is a constant 30 second delay before the Applet returns from this line: InputStream is = url.openStream();
    4) After this 30 seconds, data appears in the Applet, but it can be seen also with java console debug prints that the data seems to be buffered. The newest data shown in the Applet is not the newest data sent to the client by the PHP datasource script.
    5) On a SUSE Linux client, the Applet works as it should, there is no delay time in showing the data.
    It appears as if there is on Windows a buffering of data which I do not wish to have and which does not occur on Linux. I need to find out how to get the URL openStream() call to return immediately allowing the initial data to be read and shown on the Applet. And I need to remove the buffering of data so that the data can be shown on the Applet when it arrives.
    Can anyone help? Why does this work on Linux but not on Windows, and what can I do, at best within the Java code, to get the Applet to work on Windows as it does on Linux?
    Thanks!
    Steve, Denmark

  • How to return ResultSet from one function to another?

    Hi friends,
    Greetings.
    How do we pass the query Results from one function to another function?
    Actually i have a database in the server and i am the client.
    Client sends the id to the server as an argument. From HTML file this goes to the JSP file(which i am using as a link between HTML and EJB) and then this goes to the RemoteInterface and then to the Bean itself. The functions are written in the bean. Bean connects to the database using jdbc:odbc driver and then a query is written and executed as follows:
    In the Stateless Session Bean, there is one function with the following query.
    public ResultSet check(String id)
    //other code
    ResultSet rs = Statement.("select * from table1 where id=123");
    if(!rs.next)
    // print no such id exists. other ids are
    rs=Statement.("select * from table1");
    return rs;
    I have written it approximately only because the problem is not with the query :(
    Now, in rs there's a resultset. Now how do i display it in a tabular format in HTML? This should obviously be done using JSP. How can we do it?
    In JSP file if i write
    ResultSet rs1=Remote.check(12);
    i get NullPointerException
    Thank you in anticipation to your reply!
    Regards

    Crossposted over all places:
    [http://forums.sun.com/thread.jspa?threadID=5336533]
    [http://forums.sun.com/thread.jspa?threadID=5336534]
    [http://forums.sun.com/thread.jspa?threadID=5336532]
    [http://forums.sun.com/thread.jspa?threadID=5336519]
    [http://forums.sun.com/thread.jspa?threadID=5336510]
    Stop crossposting. It's very rude.

  • How to get the return values from a web page

    Hi all :
       how to get the return values from a web page ?  I mean how pass values betwen webflow and web page ?
    thank you very much
    Edited by: jingying Sony on Apr 15, 2010 6:15 AM
    Edited by: jingying Sony on Apr 15, 2010 6:18 AM

    Hi,
    What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
    Regards,
    Karri

  • Getting Return values from RFC function call with visual basic

    Hi,
    I am creating a sample app to connect to a SAP system which call its RFC functions created with ABAP. It was known that the function will return more than 1 return values.
       SAP Function name ==> "ZFMTP_RFC_GET_RESULT"
            Export parameters (to SAP):
                    - Student Name [char 10]         ==> "STUNAME"
                    - Student ID         [char 20]        ==> "STUID"
           Return values (From SAP):
                    - Results [char 10]        ==> "RESULT"
                    - Remarks [char 200]        ==> "REMARKS"
    i have managed to get sample codes for connecting and call a RFC function with vb but they only get a return value. How do i retrieve multiple return values like the above function "RESULT" and "REMARKS"?
    Here's my vb code to accessing the function
            Dim R3 As Object
            Dim FBFunc As Object
            Dim returnFunc As Boolean
            Dim connected As Boolean
            R3 = CreateObject("SAP.Functions")
            R3.Connection.Client = "000"
            R3.Connection.User = "BCUSER"
            R3.Connection.Password = "minisap"
            R3.Connection.Language = "DE"
            R3.Connection.System = "dtsystem"
            R3.Connection.Applicationserver = "xxx.xxx.xxx.xxx" 
            connected = R3.Connection.Logon(0, True)
            If connected <> True Then
                MsgBox("Unable to connect to SAP")
            End If
            FBFunc = R3.add("ZFMTP_RFC_GET_RESULT")
            FBFunc.exports("STUNAME") = "Jonny"
            FBFunc.exports("STUID") = "12345"
            returnFunc = FBFunc.Call() <<== How do i get the return value? or RESULT and REMARKS of the RFC Function?
    thanks alot.
    Edited by: Eugene Tan on Mar 4, 2008 7:17 AM

    Hi Gregor,
    Thanks for the link....i am having some doubts with the codes, hope you can clarify them for me if you know the codes..
    Below is the code snippet.
    Set impReturn = CHPASS_FN.Imports("RETURN")  <<=== is RETURN the standard keyword to get a                                                                                return object?
      expPassword.Value = currpass
      expNewPass.Value = newpass
      expFillRet.Value = "1"
    ''' Call change password function
      If CHPASS_FN.Call = True Then
        outFile.Write (", Called Function")
        Message = impReturn("MESSAGE") <<==== So if i have 3 return values..i just replace with the return                                                               value variable names?
        outFile.WriteLine " : " & Message
      Else
        outFile.Write (", Call to function failed")
      End If
    thanks alot...all your help is very appreciated.

  • Why do I get two different results from the same coefficients?

    I am getting two different results from the Polynomial Evaluation function.
    For the first one, I am getting the coefficients from a Polynomial Fit function.  I feed the coefficients from the Fit function into the Poly Eval function and get the correct result of 12.8582 when I evaluate 49940.
    For the second one, I create constant array of the SAME values that were returned from the Polynomial Fit function (i typed them in).  However, I am getting an incorrect result of -120.7913 when I feed the constant array into the Poly Eval function when I evauate 49940.
    How can this happen when I am using the same array values?
    Attached is an image of what I am explaining.
    Solved!
    Go to Solution.
    Attachments:
    polynomial_evaluation.jpg ‏213 KB

    Hi Altran,
    are you sure about using the "same" coefficients?
    Did you compare them? Did you (atleast) set the display properties to 17 significant digits?
    Please attach a VI instead of a picture...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can I get the XML structure from a flat structure?

    Hi all,
    in my XI SP 12 I use a JMS adapter to read information using the WebSphereMQ transport protocol.
    The structure that I receive have this format:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value>
    <NumberRecordType_B><NumberRecordType_c>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    the problem is that in this structure each line is not separated by a carriage return or a comma, I have all the information in a single line:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value><NumberRecordType_B><NumberRecordType_c><Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>...<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value><Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>...<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    and the customer don't want to insert a line separator.
    Then, the question is:
    How can I get the XML structure from this structure?
    If possible, I don't want to develop new Module and add it in the JMS Module Sequence.
    PS I have already read the article "How to Use the Content Conversion Module with the XI 3 J2EE JMS Adapter.pdf" and it doesn't seem to help me.
    Best Regards,
    Paolo

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          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.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • How do I get text to flow from one page to the next in Pages 5?

    How do I get text to flow from one page to the next in Pages 5 with the Maverick system?

    What may be overlooked in Pages v5 is the notion of combining Text Boxes via the Menu > View > Show Arrange Tools. When you select two Text Boxes, an extra panel unfolds at the bottom of the Arrange Tools window. Uncheck one Text Box and this panel abruptly disappears.
    One can achieve text flow effects between Text Boxes differently based on how one positions the Text Box overlap, and choice of effect above. Though not the accustomed flow found in Pages ’09 v4.3, flow does occur. Consider the possibilities of combining a Shape and a Text box to cut an irregular Text box.
    If I create two Text Boxes and position them side by side with outline touching and choose Unite, this creates one larger Text Box and text flows across and down. On the otherhand, if I overlap the upper left corner of a lower Text Box over one above and to the left, then choose Union, pasted text fills the first Text Box and then flows across and down into the other box. Here is a Union example:
    Intersect will leave a small Text Box where the two overlap, so not much value there. Subtract will cut a chunk out of one Text Box that is the size of the overlapping piece of the second Text Box:
    And Intersect will leave an island in the center where the two Text Box overlap, with flow jumping over this bridge.
    Clearly, this is not what we were accustomed to in the past, but with imagination, style, and layout tuning, it does offer alternative Text Box creativity and layout. Of course, there is the option of simply returning to the previous Pages version for true Text Box linking that most will want to use.

  • How do I get home video clips from iMovie Mac to iMovie iPad?  Surely there is some degree of cross-compatibility?  I have a load of clips in iMovie on my MBP that I wanna download to my iPad2 so that I can edit movies on the move.  Any ideas?

    How do I get home video clips from iMovie Mac to iMovie iPad?  Surely there is some degree of cross-compatibility?  I have a load of clips in iMovie on my MBP that I wanna download to my iPad2 so that I can edit movies on the move.  Any ideas?  (The clips are in a .mov format, they have been imported / converted into this format in iMovie, original files were from a JVC camcorder in some other strange format.)

    I copied the iTunes file from the external drive and it's in both places.  I thought all I would need is the iTunes program (which I downloaded to new computer) and my iTunes library file.  There must be something else that's missing.  My iTunes library looks the same on the new computer as it does when I open it on the external drive.  If I click on an iTunes library song from my new computer, it will only play if I have the external drive plugged in.
    My back-up drive is a mess.  I have multiple copies of music, video, photo, and document files and I don't know how that happened. ={  Obviously, I don't know how to back up stuff properly and there are back-up files extending over a 6- to 8-year period.  I think all I did was just drag and drop the main folders from the back-up drive to the same main folders on the C: drive.  Also (and I'm kind of fuzzy on this) Windows used to automatically save music files in a folder within my document files (which makes no sense to me).  As my Jewish friends would say, "Oy Vey!" 

  • How do I copy multiple email addresses from one email sent TO me into a new message?

    How do I copy multiple email addresses from an email sent to me into a new message?

    Are they in the body of the mail?
    Hold your finger down in that mail until the little blue bubble pops up. One of the options should be to select all. Choose that and all will be hilighted. then a pop up comes up to copy, choose that, open your destination and hold your finger down to get the paste dialogue.

  • How do you get multiple screens on the iPad with iOS 5.1.1?

    How do you get multiple screens on the iPad with iOS 5.1.1? We just upgraded to iOS 5.1.1, and we see no way to be able to open multiple screens at once. Before, there was a small button in the upper portion of any window. That button would take you from a particular window to the place where multiple windows are open at once. Does it do it differently? Is there a special setting button that we have missed? Thanks!
    One more thing: We are only talking about Safari.

    Guitaristica-
    I don't think I've seen a way to have separate Safari screens visible at the same time.  The small thumbnails were deleted in one of the iOS updates, and replaced with a multiple "Tab" system.
    You can open an additional screen in a new "tab" by pressing and holding on a link until a new menu comes up.
    Fred

  • How can I get these two results in two different columns?

    SELECT COUNT(attr_id)
    FROM pv_attribute
    WHERE port_id = 322;
    SELECT COUNT(attr_id)
    FROM pv_attribute
    WHERE port_id = 323;
    How can I get these two results in two different columns?
    Thanks

    So Jens made a tiny mistake with the column name... shame you couldn't be bothered to research Pivoting so you could have corrected the mistake (possibly it was deliberate *{:-) ) and learnt something.
    with pv_attribute as (select 16123 attr_id, 322 port_id from dual union all
                          select 16123 attr_id, 322 port_id from dual union all
                          select 19223 attr_id, 322 port_id from dual union all
                          select 11193 attr_id, 323 port_id from dual union all
                          select 13163 attr_id, 323 port_id from dual)
    -- end of test data setup
    select sum(decode(port_id, 322, 1, 0)) cnt_322,
           sum(decode(port_id, 323, 1, 0)) cnt_323
    from   pv_attribute
    where  port_id in (322, 323)

Maybe you are looking for

  • Implementing a team classpath?

    I'm on a team of 3 developers who are looking at Flex as one of our new development environments. Working with it, I created a custom (mxml) component. For argument's sake, let's call it "MyComponent". I want to have an area that ALL the code we writ

  • SAP NetWeaver Development Infrastructure in Trial version

    [Here|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0576c7e-e306-2a10-37b8-a25d82e6f9d8] I see, that "SAP NetWeaver Development Infrastructure" is included in "SAP NetWeaver 7.0 Java Trial Version", But, in documents after down

  • Open the OpenOffice document in Internet explorer

    How to open the OpenOffice Document in Internet explorer using core java?

  • How to lock Oracle SQL developer 1.5.1

    Hi, If you run a PL/SQL block on a page that takes some time and while still processing you try to see a table it locks. Running: Windows XP, Oracle SQL Developer 1.5.1, jdk 1.6.07, Orcacle 10g. Greetings,

  • Creation of handling unit through VL01N

    HI ALL, i have a requirement like in vl01n we will give shipping point and sales order and we press enter and we will give picking quantity and we will press save button . here when ever i press save button i need delivery number with auto packing ha