How can I get multiple results returned from a function

IDBASKET IDSTAGE DTSTAGE
---------- ---------- ---------
3 1 24 JANUARY 03
3 5 25 JANUARY 03
4 1 13 FEBRUARY 03
4 5 13 FEBRUARY 03
5 3 21 FEBRUARY 03


I have entry is a unique number of the IDBASKET in this table and this feature works very well that if she has an IDSTAGE by idbasket. (idbasket #5)
But how do I return a result for an IDBASKET when there several IDSTAGE? (idbasket #3 & 4)
Thank you very much
CARPET


SQL > CREATE or REPLACE FUNCTION status_desc_sf
2 (NUMBER Code_P)
3 RETURN VARCHAR2
4 EAST
5 lv_output_txt VARCHAR2 (30);
6 BEGIN
7. If Code_P = 1 THEN lv_output_txt: = "Command" submitted
8 ELSIF Code_P = 2 THEN lv_output_txt: = "Accepted, sent to the navigation";
9 ELSIF Code_P = 3 THEN lv_output_txt: = 'out of stock ';
10 ELSIF Code_P = 4 THEN lv_output_txt: = "Cancelled";
11 ELSIF Code_P = 5 THEN lv_output_txt: = "shipped";
12 lv_output_txt ELSE: not = 'no information ';
13 END IF;
14 lv_output_txt of RETURN;
15 END;
16.

I think that your function works as expected, not necessary as you like it is running.
See the example:

SQL> create table t11(c1 int, c2 int)
  2  /

Table created.

SQL> insert into t11(c1,c2) values(1,1);

1 row created.

SQL> insert into t11(c1,c2) values(1,2);

1 row created.

SQL> insert into t11(c1,c2) values(2,2);

1 row created.

SQL> create or replace function func2(p_code number)
  2  return varchar2
  3  is
  4  v_output varchar2(64);
  5  begin
  6  if p_code = 1 then
  7     v_output := 'Submitted';
  8  elsif p_code = 2 then
  9     v_output := 'Accepted';
 10  end if;
 11  return v_output;
 12  end func2;
 13  /

Function created.

SQL> /

        C1 test
---------- ------------------------------
         1 Submitted
         1 Accepted
         2 Accepted

If you have run the function in a manner similar to mine, it will work for all ranks. Your design of the table shows that keep you track of each State of your order, so you have more than one State of each basket. If you want to view only the last State of each basket, please take a look at this example:

SQL> alter table t11 add c3 date
  2  /

Table altered.

SQL> update t11 set c3 = sysdate - 1 where c1 = 1 and c2 = 1
  2  /

1 row updated.

SQL> update t11 set c3 = sysdate  where c1 = 1 and c2 = 2
  2  /

1 row updated.

SQL> update t11 set c3 = sysdate  where c1 = 2
  2  /

1 row updated.

SQL> select * from t11
  2  /

        C1         C2 C3
---------- ---------- ---------
         1          1 15-JUN-09
         1          2 16-JUN-09
         2          2 16-JUN-09

SQL> ed
Wrote file afiedt.buf

  1  select t11.c1, func2(t11.c2) "test"
  2  from t11, (select c1, max(c3) c3 from t11 group by c1) a
  3* where t11.c1 = a.c1 and t11.c3 = a.c3
SQL> /

        C1 test
---------- ------------------------------
         1 Accepted
         2 Accepted

With greetings
Krystian Zieja

Tags: Database

Similar Questions

  • How can I get the filtered data from the first form

    How can I get the filtered data from the first form in a second form to make an update of the multi.
    Thank you very much

    William,

    I would use for this collections. A link is good if you need to pass a single value.

    1. create a collection
    2 fill the collection with your result set
    3. go in the page target and uses a method of a query in your link to this page
    4. your target page receives a request and allows you to edit documents.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • How can I get back my default from Itunes to window media

    How can I get back my default from Itunes to window media

    http://Windows.Microsoft.com/en-us/Windows-Vista/change-which-programs-Windows-uses-by-default

    Change the programs that Windows uses by default

    http://www.vista4beginners.com/set-your-default-programs

    Read the above info.

    How to set file Associations:

    http://articles.TechRepublic.com.com/5100-10878_11-6172036.html

    How do I... Change file extension associations in Windows Vista?

    See you soon.

    Mick Murphy - Microsoft partner

  • When I type in the address bar, yahoo search results appear. This just started happening, he showed the results of google search before. How can I get the results from google instead of yahoo?

    If I type "NBA" in the address bar, I get results from yahoo. I don't want the results of yahoo, I want Google results. This just started today. How can I get Google search results to show after typing in the address bar?

    1. Type of topic: config in the address bar and press on enter
    2. Accept the warning message that appears, you will be taken to a list of preferences
    3. Locate the preference keyword. URL, right-click on it and choose reset

    This will restore it to Google.

  • How can I get my vista returns with no password?

    My hard drive crashed. IM waiting to get a new internal hard drive and apparently my files is stored on an external hard drive that I bought recently. Now I realize I lost not only the recovery disks for my windows vista 64 bit, I also lost the box that my laptop came out if I could still borrow a copy from friends, I still wouldn't have my correct code. I think my name must be in some kind of records, right? How can I get my password back so I have cabin recharge my vista?  don't want to have to buy it again... ! Thank you

    Personal information and product keys are not stored in the same databases of MS.

    Your product key is on the computer itself (assuming that it is a large manufacturer) - on the COA sticker or on the matter, o in the battery compartment.

    Note that if you reinstall using the manufacturer's recovery disks, you should not have your own product key at all, as the discs contian, sing the manufacturer of own key, which activates the BIOS on the computer.

  • How can I get multiple video Formats to a size?

    I am new to first... so, thank you for the help!


    I have several files from different cameras submitted by individuals. They have different resolutions and it's havoc on my outings.

    My previous software automatically adjusts the video to fit the screen.

    How can I get first to do this and better quality?

    Thank you for taking the time to take a look.

    Eric

    Hi Eric,.

    In Edit > Prefs > General, there is a checkbox for "Auto scale to frame size. Which allow, and clips imported after that change will be automatically resized to fill the size of the current framework. For clips imported already before the change, you right-click and choose manually the scale to the framework on the clips in your sequence.

    Ideally, you should understand which format you want to deliver and start from there. For example, if the final product will be on DVD, then 720 x 480 is the size to work with, and you start with a DV NTSC preset and clips to adapt to the scale. Not a good idea for any increase, you will lose quality, so not to recommend full 1920 x 1080 HD if your sources are all small.

    Also pay attention to the PACE. You can mix them, but decide which is the most widespread and which may be the one to use, depends on however. If you can give examples of what you have to work with, and where it goes (DVD, YouTube, etc.) then you can get more specific advice

    Jeff Pulera

    Safe Harbor computers

  • Envy 15 laptop t: How can I get rid of messages from triangle yellow if I don't want the update?

    I get messages in the form of a yellow triangle with an exclamation point, and when I click on it I found supposed updates. How can I get rid of these so I do not understand all the time reminders?

    Hello @nininger,

    Thanks for the quick response!

    In your original post, it was not indicated if you receive updates via the HP Support Assistant, or the update of Windows.  If you receive messages via the HP Support Assistant, you should be able to go into the tool and change the way you receive notifications.  You can consult the following document to help you, if necessary:

    HP computers - using HP Support Assistant (Windows 10, 8, 7)

    Kind regards!

  • How can I get a free upgrade from Vista to Windows 10?

    I have windows vista, how can I get 10 free windows please?

    [Original title: windows 10]

    Windows 10 was proposed only for Win7 users and 8.1, Win8 even not.

  • How can I get good results from the detection of matching/shape of reason for this image?

    I need to be able to identify all nine squares in the first image (0000094718...) and others like him.  I tried to detect shape, filtering and geometric pattern match.  I tried to vary all parameters within these functions.  I tried the image preprocessing (and the model, if any: usually created from only one of the boxes) with thresholding and/or a muliplier before using the detection or the corresponding function and I still can not get all nine boxes and only these nine boxes.

    Can someone offer some help?  Ideally I would be able to use the shape detection, because it returns the coordinates of the corner rectangles and those who are particularly useful to me.  What confuses me about this feature, is that after setting the width/height minimum/maximum of rectangles to find, the program seems to ignore these instructions and returns matches outside these limits.

    It would be even better to be able to have a script which will identify all nine boxes in two attached images.  The boxes in the second image (X820A32) are more square.

    Thank you

    Holly

    Try the attached script.  I think that you use only may not be the optimal threshold values.  You may find that you want to use a smoothing filter before making the threshold.  This should also help with nuisance particles.

  • How can I get my favicon return?

    In an attempt to 'clean up' some apparently unused javascript of my help topics, my boss asked me to build my webhelp with two checkboxes "Section 508 Compliant Output" and "Topics in accordance with W3C" selected. Stupidly, I agree. The result has no effect on javascript but haven't set my custom skin traditional Style and displays the favicon of IE instead of our custom logo.

    I have deselected the two checkboxes and selected my skin again, but I can't get my favicon to reappear.

    The whstart.ico in the Webhelp folder is the same as icon above.

    I pasted a previous version of how to start in the Webhelp folder. The JavaScript at the top of the page seems to be OK. It's

    < head >
    < script language = "javascript" >
    <!--
    var sIcon = "whstart.ico";
    var sPath = document.location.href;
    If (sPath.indexOf ("http")! = - 1).
    document. Write ("< link REL = \"RACCOURCI ICON\ "href =------" "+ sIcon +" \ ">" ");
    ->
    < /script >
    < title > Sopheon Accolade help < /title >

    < name meta = "generator" content = "Adobe RoboHelp 8" / >
    < name meta = "description" content = "WebHelp 5.50" / >

    < / head >

    And the whstart.ico is always correct in the folder to install to C:\Program Files (x 86) \Adobe\Adobe Technical Communication Suite 2\Adobe RoboHelp 8\RoboHTML\WebHelp5Ext\template_skin

    Someone at - it other ideas what I might need to do to get the favicon to return?

    I just thought to restart RoboHelp and clear memory cache IEs then restarting him but didn't want to lose this position. If these steps do not help, will comment later. (These steps did not help either.)

    At the same time, if I missed something else, please advise.

    John

    Post edited by: John D 67995437

    The answer: the icon appears on the version on the server and not on the version on my local machine.

    Sorry for everyone with this sentence, but glad to know that I made myself do things. :-)

    John

  • How can I get my normal return

    * Original title: I can't get my sound back because some 1 has messed with my computer how to fix my normal returning? /

    a friend plugged in headphones and I canoe change back?

    Hello

     

    I suggest you to please follow the steps described in the links below and check if it helps.

    Run the audio Troubleshooter and check.

    http://Windows.Microsoft.com/en-us/Windows7/open-the-playing-audio-Troubleshooter

    No sound in Windows

    http://Windows.Microsoft.com/en-us/Windows/help/no-sound-in-Windows

     


    Tips for solving common audio problems

    http://Windows.Microsoft.com/en-us/Windows7/tips-for-fixing-common-sound-problems

    Let us know if it helps!

  • How can I get adobe cc removed from my computer? I got a free month trial, but because I'm unemployed now I will not sign upward

    How can I remove all traces of adobe cc from my pc? Because I'm unemployed now that I will no longer be interested. Sincerely, Rainbow Ray.

    Managed to get thank you sorted it. Sincerely, Ray.

    Sent from Windows Mail

  • How can I get all my purchases from my Apple accounts when I move in other countries?

    I can't renew everything that I have both in France... 6 years turned to the basket and is really a shame to Apple to make accounts separately.

    I moved from Chicago in Italy, I lost years of purchase, I moved to the Italy in the France, I lost years of buying... Now once again...

    My music all gone... I can't renew applications or whatever it is that I already have both.

    In France, they said to call Apple Italy and bought agreed, you're screwed with apple after all.

    Then you give me any solution...

    I still have accounts in Italy, USA and France, but I can't transfer even if I am the owner of the account... Very sad, after all this year is as coward brand new...

    I have an IPAD - 2 IPHONEs and MACBOOK PRO...

    How can I United all my accounts and stop wasting my purchase?

    As long as you have your ID - you have your purchases

    Now some applications may not be available in some countries

    But simply moving over geographical areas should not cause you to lose the content.

    Can you please give us the exact things you are trying to do - on what device and this error messages if any?

  • How can I get the smallest pdf from InDesign CS4, but keep some sharpness?

    I have a brochure of 2 pages, front and back with layered photoshop files, and when I do the small pdf, I need to make a file of 100kb as a customer has done in the past. The smallest, I can do the PDF is 460kb.  He'll be no smaller, no matter what I do. Of course I can enter final resolution as 72 dpi, but photos are very blurred. I have even reduced the size of the files of the photos and replaced in the document. The size of the file remains the same.  My client said that reduced Illustrator for him plus size small in the past but I don't think it's the solution.  How can I you keep some sharpness in a pdf file but keep the size of the file to a bare minimum?

    But InDesign CS4 out the file no matter what happens to 460 k for me.

    Still don't know why they got 100 KB.

    By not using not InDesign. Scott is on the right track by mentioning Distiller - what makes PDF files which is smaller than InDesign can export. Illustrator can be used (bad *) in the same way. Both methods can remove stuff that you don't need if you don't care the print quality don't care about reliable display on multiple platforms, don't care exactly how your fonts are included, don't care about the trial that blind people using screen readers will sue you and so on. I don't know what above is not in your customer file 100 k, or that things in my list above will be eliminated out using Distiller or Illustrator, but I bet that one of the people that has already been posted in your thread is known and can be talked about telling us.

    But, if you try to make your customers happy and are not actually personally invested to make the smaller PDF files known to man, and if you are located in the United States, then maybe the phrases "blind screen... readers accessibility... trial" spoken together could encourage your client to rethink this arbitrary will of tiny size of PDF files.

    Alternatively, you can just save postscript on the two PDF files and just watch the .ps files in your favorite plain text viewer.

    * I'm surprised that Adobe employee Dov Isaacs did not come tell us what it is a bad idea.

  • I just installed a new drive faster. How can I get windows live mail from the old drive to the new drive

    Where are the files stored WindowsLiveMail?  Under what article directory.  I have "tons" of e-mail messages stored on the old disk and need to move them to the new drive faster.  How can I do?

    The location of the store folder, which contains all the messages, calendars and the account settings, is configurable by the user. The default location is
    C:\Users\{user}\AppData\Local\Microsoft\Windows Live Mail

    If the installer of WLMail is a record storage in the default location, it normally acknowledge and take into use if. The only user that would be required should reinstate saved passwords. If this is to succeed, the old and new installations of WLMail normally must be exactly the same construction. The storage location must be in place in the default location on the new drive before installing WLMail. Also, the current user must be the owner of the record store to its new location.

    If the old drive is installed on the same computer as the new facility in WLMail, you can point the Import Wizard to import messages to the old folder of the store. They will find under storage folders into imported folders.

Maybe you are looking for

  • Since my system automatically upgrade 17.0.1, I had problems with many Web sites.

    I do not receive the error messages, they do not work! If I open another browser, they work perfectly, but as soon as I try to reuse them in Firefox, they do not work - many examples - a site of the game won't let me start the game, just think contin

  • Z500 UPGRADE RAM

    Hello everyonemy name is ahsan, I have a z500 ideapad laptop corei7 3612QM with 8 GB of DDR3 RAM,. I want to upgrade my laptop to 16 GB of RAM. I've seen a few posts where it says that the maximum capacity is 16 GB of RAM. I also saw a few manuals Le

  • Acquisition of analog camera field.

    I'm trying to shoot maximum performance of my analog camera. I have a capture card 1405 and the camera is monochrome RS 170 NTSC. In time real LV 2009 SP1. Unfortunately, I have to use to track movement and there is no way at this point to upgrade th

  • 249tu HP 15r: QUESTION

    Network device driver is not installed on my laptop... WiFi and bluetooth does not work... The driver is missing... How can I solve the problem? What can I doenload? Please tell me the solution.

  • What do you do with old products you have left when they expire?

    What happens to the packages you have left after the expiration date?