How to return a message of a function

Hi gurus,
I wrote the function on my database related to the return of the specific table voucherdate
I want to return one message if other that this condition means that if vouchers No. is not there or if there is no null vouchertype is provided.

my function is
-------------------
create or replace fn_get_voucherdate (v_vouchertype in varchar2, v_compcode in numbers)
date of return
as
date of v_voucherdate;
Start
If v_vouchertype = "B - P" then
Select max (voucherdate) from v_voucherdate
from sometables where vouchertype = v_vouchertype and companycode = v_compcode;

Return v_voucherdate;

elsif v_vouchertype = "C - P" then
Select max (voucherdate) from v_voucherdate
from someothertables where vouchertype = v_vouchertype and companycode = v_compcode;

Return v_voucherdate;

elsif v_vouchertype = "C - R" then
Select max (voucherdate) from v_voucherdate
from someothertables where vouchertype = v_vouchertype and companycode = v_compcode;

Return v_voucherdate;

elsif v_vouchertype = s-P' then
Select max (voucherdate) from v_voucherdate
from someothertables where vouchertype = v_vouchertype and companycode = v_compcode;

Return v_voucherdate;
on the other
return a message here;
end if;

but the message by not returning function showing no matter what return value error

Please guide me how display a message to the user.

Please answer...

but the message by not returning function showing no matter what return value error

as it is coded your function returns a DATE data type
It cannot return any "message".

Tags: Database

Similar Questions

  • How to return multiple variables from a function

    Hello

    As seen below, I tried more then return a variable to a function, but I think I have a syntax problem...

    function hesapla3 (parameter1, parameter 2): (number & & Boolean) / / PROBLEM IS HERE, I have NEED of TWO VARIABLES to RETURN
    {
    var yenideger2:Number = new Number();
    var bol2:Boolean = new Boolean();
    yenideger2 = parameter1 + parameter 2;
    if(yenideger2>80) {bol2 = false ;}
    Return yenideger2;
    return bol2;
    trace (yenideger2);
    trace (bol2);
    }

    You can do it this way.

    You can combine the 2 to 1 as a var

    var tekdeger:String=yenideger2.toString()+"-"+bol2.toString();

    Return tekdeger;

    and then you can split and mount the value returned into variables that you want...

  • How to return two values of a function?

    Hi all
    I have a function which returns a varchar2 value. This value is used in the SQL of a ref cursor

    Now I want this function returns two values. I tried to use varray, but could not accomplish the task.

    Can you tell me how can I find the two values from a function? and how this function can be called in a SQL query?

    Thank you very much

    The query should look like:

    SELECT v.col.name AS name
         , v.col.flag AS flag
    FROM   ( SELECT kk_test_kk(t.somecolumn,t.someothercolumn,42) AS col
             FROM   sometable t ) v;
    

    Note that you need to prefix with the name of view inline ('v' in the example) and the expression of the function ('col' in the example).

  • How to return an array from a function package

    It is a package, that give the type of table.

    But it does not work.

    create or replace package account_group is

    TYPE string_array IS the TABLE OF varchar2.

    function get_acc_by_vat_number (in_string varchar2) return string_array;

    end account_group;

    create or replace package body is account_group

    function get_acc_by_vat_number (in_string varchar2) return string_array is

    acc_array string_array;

    i the number;

    cursor c1 is

    (Select to_char (d.account_number) wiz_customer_descrip account_number d, wiz_customer_hp_life l

    where commercial_flag = 'Y '.

    and l.franchise_code! = 'F29'

    and d.account_number = l.account_number

    and id_3 = in_string - vat_number

    - and ssn ='08-09-002272' - company_reg_num

    UNION

    Select to_char (d.account_number) wiz_customer_descrip account_number d, wiz_customer_hp_life l

    where commercial_flag = 'Y '.

    and l.franchise_code = 'F29'

    and d.account_number = l.account_number

    and id_3 = in_string - vat_number

    - and ssn ='08-09-002272' - company_reg_num

    and there are

    (select 1 from WIZ_CUSTOMER_HP_OCCURRENCE p

    WHERE product_category_code in ('MID', "MVO")

    and p.account_number = l.account_number

    and p.service_address_id = l.service_address_id));

    Start

    I: = 0;

    for the news loop c1

    i: = i + 1;

    acc_array (i): = cur.account_number;

    end loop;

    Return acc_array;

    end;

    end account_group;

    Use the functions in pipeline, which give to the appellant, while the dataset is the treatment.

    create or replace package account_group is

    TYPE string_array IS the TABLE OF varchar2.

    function get_acc_by_vat_number (in_string varchar2) return string_array in pipeline;

    end account_group;

    create or replace package body is account_group

    function get_acc_by_vat_number(in_string varchar2) return pipeline string_array is

    acc_array string_array;

    i the number;

    cursor c1 is

    (Select to_char (d.account_number) wiz_customer_descrip account_number d, wiz_customer_hp_life l

    where commercial_flag = 'Y '.

    and l.franchise_code! = 'F29'

    and d.account_number = l.account_number

    and id_3 = in_string - vat_number

    - and ssn ='08-09-002272' - company_reg_num

    UNION

    Select to_char (d.account_number) wiz_customer_descrip account_number d, wiz_customer_hp_life l

    where commercial_flag = 'Y '.

    and l.franchise_code = 'F29'

    and d.account_number = l.account_number

    and id_3 = in_string - vat_number

    - and ssn ='08-09-002272' - company_reg_num

    and there are

    (select 1 from WIZ_CUSTOMER_HP_OCCURRENCE p

    WHERE product_category_code in ('MID', "MVO")

    and p.account_number = l.account_number

    and p.service_address_id = l.service_address_id));

    Start

    I: = 0;

    for the news loop c1

    pipe row (c.account_number);

    end loop;

    return;

    end;

    end account_group;

  • Can Apple Watch returns a message that was not delivered

    Periodically a message could not be sent, which is a problem in itself.  However I wonder if there is a way to send back what she just came with a warning sign that it was not distributed.  This message does not appear on the phone, so it will just be stuck there forever.  Very annoying, does anyone know how to return a message from the watch?  Thank you.

    Press about to red exclamation and you should see the option to resend the message

  • Message box in function that returns a list deletes the created list... (Dialog box)

    Hello

    I work with a complex dialogue, its purpose is to manage a section in the PDF file.

    I use a "mclv" object in the dialog box to represent data entries in the PDF file in order to manage the result in another section.

    I created a function that creates the list based on a previous section in the PDF object, the function works perfectly well.

    But I have a small question, the function used to create the list of the dialog box object performs a check with the former front list created, as appropriate,

    and if in any case it is different from the old list, I need to warn the user that the list has changed and if there were any changes applied to the result it will be returned to zero and must be recreated.

    But when the poping that message box, all lists are deleted and nothing is displayed in the objects 'mclv.

    If I remove the message box, the lists are all very well...

    Is there anyone who have come across something like this before? If so, any solution to this problem?

    I asked my question a bit too quickly, I already found a work around

    But I still don't understand why he behaves like that tho...

    I just thought how to work around this problem.

    If anyone has encountered this problem can use this solution:

    Instead of having the message inside the function to return box, I declared a global Boolean variable to the Script object

    If the message box must be displayed, the Boolean value is set to True

    Once in the initialize event of the dialog box, if the value Boolean true I call the message box and reset the value Boolean false

  • I no longer get suggested words when composing a message text on my iphone 5.  How to get back to get this function works

    I no longer get suggested words when composing a message text on my iphone 5.  How to get back to get this function works

    Make sure that the text is on. You can do this on the keyboard (if you have several) by pressing and holding down the button to change between them.

    Alternatively you can go to settings > general > keyboard and make sure predictive is turned on (the switch must be green).

    If you see the image below, press the small white bar above the buttons T and Y and slide upward slightly.

  • How to make a new paragraph in a message? Whenever I hit the button "enter/return" the message is sent and I want only to go down in a new paragraph in the message?

    How to make a new paragraph in a message? Whenever I hit the button "enter/return" the message is sent and all I want to do is make a new paragraph! Which button I hit to make a new paragraph?

    Option-return.

  • How to return to the old Web Developer Toolbar?

    I was automatically upgraded to the new Web Developer toolbar, but it has TWO flaws. One is a big problem!
    (1) the search box to change the CSS and the "Close" button is on the right. For as long as I used it, it was on the left. So now, we must all go how we use them.
    (2) (big prob) the function of hierarchical table cells expose them, but unlike the old tool (same year), it also puts to * td * and if it breaks the layout of the site while you try just to see the 'lines' hence are cells.

    Thus, for example: a menu where just the links in shape - they go in all directions, because the ' td who show up, forcing.

    How to return to the old web developer who was simple and better tool?

    UPDATE: I also Can not stop he said "div div div '... When I saw the block-level elements.

    There must be a way to turn off?

    On the addons site, if you scroll down and expand the list of Versions, you can find the page with the old versions. Don't know exactly how to prevent it from re-updated, however.

  • How to return to firefox 3.6.14? 3.6.15 crashes when I open it.

    How to return to the previous version of firefox (3.6.14)?

    I installed Firefox 3.6.15 last night and updated all my plugins. Now, Firefox crashes immediately after opening. I am running Vista Ultimate.

    There is no incident information. I just get the message "firefox has stopped working". Here's the info of who:
    Signature of the problem:

     Problem Event Name:	APPCRASH
     Application Name:	firefox.exe
     Application Version:	1.9.2.4079
     Application Timestamp:	4d6fb7c0
     Fault Module Name:	ntdll.dll
     Fault Module Version:	6.0.6002.18327
     Fault Module Timestamp:	4cb73436
     Exception Code:	c0000005
     Exception Offset:	000469ce
     OS Version:	6.0.6002.2.2.0.256.1
     Locale ID:	1033
     Additional Information 1:	1a9e
     Additional Information 2:	ca321f9d3309051b0d4a7a671dc893c6
     Additional Information 3:	4a7f
     Additional Information 4:	71f11eaed1268bd63f4a971e81cd5649
    

    Read our privacy statement:

     http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409
    

    I solved just a Firefox crashing problem on my system. The problem was that security software Norton had deleted a necessary file. The file is C:/Program Files(x86) /Mozilla Firefox/plugin - container.exe. If this file is not there, you must reinstall Firefox, and then you should be good to go.

  • E Mail sent by Postmaster. How to return to fix Add. without having to retype everything? Hot mail

    IAM using Hot Mail and an email I sent to the wrong address, was returned to me by the postmaster.  How to return this email to the correct address without having to retype all email that is such that he was sent originally?  Thank you.

    Either change the address or copy & paste the text into a new message.

    FYI: Hotmail has its own forum here.

    Windows Live Solution Center Hotmail Forum
    http://windowslivehelp.com/forums.aspx?ProductID=1

  • How to return to the previous screen on Pre apps? THETE´s no back button... just close the application and start over?

    for example with text messages once im in a conversation can how to return to the screen with all my converdations? It's the same with any of the apps, West no way to go back? should I always close the app and start again to go to the previous screen?

    You must not yet be aware of the gesture «back» It goes like this, the straight shot, left on the gesture area (the area below the screen, left and right of the Center button). You enter only at half way, and you can start on the right edge, or just left of the Center button.

    Become very familiar with this gesture he used all the time.

    There is also an option that you can activate by allowing a complete sweep in any direction will take you to the adjacent open card. I think that this gesture is set to off by default.

    Good luck.

    PS - In the application of Navigation of Sprint, I can't seem to leave the navigation once it starts. In other words, you must close the application and open again to define a new topic. I know two ways to issue the command to stop the navigation, but none of them work effectively.

    Message edited by Mrolesen on 21/06/2009 20:17
  • pages Web keep growing smaller. How to return to a regualr screen size?

    Original title : there is a button or function tghat guard making eb smaller pages?  How to return to the regualr size?

    I don't see that anything the print is so small?  How to get back?  What is the key that does this?

    When you view a web page, on your keyboard and hold down CTRL and press on the + or - button to increase or decrease the text size.

    Using CTRL and + key will enlarge the text.
    With the help of the CTRL and - key keys will shrink text.

  • WINDOWS WITH OUTLOOK 13 8.1. MAIL server error RETURNED WITH MESSAGE 550.

    I USE WINDOWS 8.1 WITH OUTLOOK 13. MAIL server error RETURNED WITH MESSAGE 550. Please login to use this mail server. How can I do this?

    So that we can look into this further, please provide the affected email account and complements of NDR (or error), you received so that we can determine the cause of this problem. To do this, please follow the steps below:

    1 right click on the message to bounce on your Inbox.

    2 choose the option show message source on the menu drop-down. You will see a window containing the headers of e-mail messages and content.

    After doing so, to validate the source of the message with all components of the notification of non-delivery such as:

    > Final destination

    > Action

    > Status

    > Diagnostic code

  • How to return the approver e-mail notification iProcurement in R12?

    Hi all

    How to return the approver e-mail notification iProcurement in R12?

    Symptom: A Summit a requisition to B, need for approval of B

    (1) B lost the e-mail that is sent by A
    (2) need B a new notification sent by A.

    environment: Oracle R12.1.2 | AIX 6.1




    Concerning
    Terry Chen

    I thank you for your answer, you want to reassign B once again?

    Yes.

    Can I use the feature "Rewind"? Can this function sends notification to the user again?

    Don't know if it would work for notifications of iProcurement, then please try first the option to reassign.

    Thank you
    Hussein

Maybe you are looking for

  • If the mozpay is supposed to hit the postbacks URL 6 times?

    I've set up mozpay in my application. When I send the jwt signed with postbacks to the app url, and then the application use it with mozpay, during the simulation, the postbackURL gets hit 6 times. I wanted to know if that is planned. If so I can wor

  • Got wifi problem ios 9, how to fix? Help me

    WiFi problem

  • Equium P300-16 t start not at all

    Hello The problem I have is I leave the girl uses the computer laptop that she began the start-up but then decided that she would not use the laptop while she just hit the power button instead of close properly, now I can't access the laptop all the

  • Satellite P20 doesn't work anymore - clear CMOS?

    Hi all My laptop Satellite P20 no longer works, the system switches, but nothing happens, nothing on the screen, just the fans blowing air. I would like to clear CMOS, but I don't know which bridge to shorten on the motherboard. I also saw this: [htt

  • PCI-6110 - calculated resolution RMS

    We have a requirement for the resolution of measurement of voltage AC RMS. I am in a position a repetitive alternating signal with 512 samples on 1 cycle using the range full scale. I then calculate the value of these data. What is the effective reso