I want to create the function for the function create for ODD or EVEN (NUMBER)

I want to create the function for the function create for ODD or EVEN (NUMBER) also
If number is odd, multiply by 5
If there is an even number, multiply it by 10;

Not tested,

create or replace function fnc_env_odd(p_number in number)
return number as
begin
 if p_number>0  -- Remove if you want to consider negative numbers also
   if mod(p_number,2)=0 --Means even
      return p_number*10;
   else                 --Means odd
      return p_number*5
   end if;
 end if;
end;
/

G.

Tags: Database

Similar Questions

  • Create function for ODD or EVEN (NUMBER) in pls sql

    Create the function for ODD or EVEN (NUMBER) also
    If number is odd, multiply by 5
    If there is an even number, multiply it by 10;

    865253 wrote:
    Create the function for ODD or EVEN (NUMBER) also
    If number is odd, multiply by 5
    If there is an even number, multiply it by 10;

    create function fn_get_no (n_in in number) return number is
    o_num number;
    begin
    if mod(n_in,2) = 0 then
    o_num := n_in*10;
    else
    o_num := n_in*5;
    end if;
    return o_num;
    end;
    
    select fn_get_no(5) odd, fn_get_no(4) even from dual;
    ODD EVEN
    25 40 
    

    Vivek L

  • How can I recover only odd or even number of records in the table?

    Hello

    How can I recover only odd or even number of records in the table?

    Thank you

    Hi IndiMinds,

    Alternatively, you can use in queries. :

    Odd:

    SELECT *.

    Of

    (SELECT rownum row_count, id, name FROM bigemp

    )

    WHERE mod (row_count, 2) = 1;

    Still:

    SELECT *.

    Of

    (SELECT rownum row_count, id, name FROM bigemp

    )

    WHERE mod (row_count, 2) = 0;

    Thank you

  • Firefox sometimes want to load the version 3.6.4 update even if the version is already 3.6.4

    Firefox want to update the version 3.6.4 even if the version is already 3.6.4
    and if she won't update, he's looking for server but nothing happens.

    This has happened

    Don't know how many times

    == update version 3.6.4

    Thanks to the efforts of current development on Firefox 3.6.4, there was several versions with the same version number (3.6.4) published as automatic updates for users of the beta like you.

    I see that you do not use the latest version, which was made on 5/27 (you run a generation 5/23).

    I don't understand the problem you are experiencing with software update (Please specify), but try this:

    After closing Firefox, delete the files in the folder updates and updates\0 :
    C:\Users\ < user > \AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates
    C:\Program Files\Mozilla Firefox\updates\

    Then try the update again.

    If this fails, download the latest version from http://www.mozilla.com/en-US/firefox/all-beta.html and install it.

    See http://kb.mozillazine.org/Software_Update (Software Update doesn't work does not correctly)

  • 5.6 pages | Different headers for odd and even pages

    My neighbor has 5.6 Pages and may not know how to format the document in order to have even pages and odd different headers. I am using Pages 08 and this version has a parameter "Pages are different." However, I can't find this 5.6 Pages feature.

    Is this possible in 5.6? If so, can someone tell me how, I can help him out?

    Thank you

    N ° feature not supported in any version of v5 Pages.

  • Automatic Update keeps wanting to install the same 5 updates every day even after what they are already installed.

    The automatic update keeps eager to download and install the same 5 updates daily. These 5 updates are KB979909, KB982168 KB982524, KB983583, KB2418241. I looked at the log of update and it showes them already installed. This has happened since November. What can I do?

    See this response archived from a previous thread:

    http://social.answers.Microsoft.com/forums/en-us/vistawu/thread/32ba77cb-cff2-4155-b70d-e31b7ba4c8df >

  • Different margins for odd and even pages

    Hi all

    Is there a way that we can change the margins on the PDF based on the number of page. Odd pages say have the margin set to 2.45 cm while the odd pages only to 1.6 cm? Thank you!

    We use Documaker Studio 12.3.

    There is nothing in the Documaker PDF driver that's going to change the margins for you. Assuming that you cannot design forms with desired margins (e.g. for printing of transactional document), then your best bet is to find a third-party tool that will adjust the PDF file after it is generated by Documaker. Personally, I don't know of a tool that does this, but a Google search may help you find a tool that meets your needs. For example, I found the following which suggests to use GhostScript to add margins - pdf - how I automatically add a margin to each pair page?-Graphic Design Exchange of battery

    I hope this helps.

  • How do we uninstall the standard American dictionary? I just want to use the English/Australian Dictionary.

    I don't want to use the American dictionary by default. Even though I have the English/Australian dictionary installed, whenever I use a word which, in Australia, has a "but in the States has a 'z' the word highlighted as incorrect. For example. Australia: 'organization '. US: 'organization' - the word 'organization' is highlighted as an error even if it is not. In other words, the American dictionary outweighs my installed English/Australian Dictionary that makes this totally superfluous English Dictionary and I wonder why it is proposed in the first place. I would like to delete the American dictionary, but can't find it for the kill.

    Under Linux, you will find dictionaries in/usr/lib/firefox/dictionaries. You'll need to Preobrajensky root to remove.

  • I want to create a photomerge. The dropdown under 'Enhance' for this option does not appear. What I am doing wrong?

    I want to create a photomerge. The dropdown under 'Enhance' for this option does not appear. What I am doing wrong?

    What version of PES do you have?

    In PSE14, we moved the entry point for the function Photomerge in the guided view edits.

    In this bar at the top of the editor, click on guided, and then there will be a number of category tabs at the top. Click on Photomerge, and you should be good to go.

    See you soon

    Bob

  • I do my job to the computer on a MAC computer. I want to create a document using Pages and then convert the document to PDF and send a group email. I want to send the PDF using the pdf for each receiver icon must click the icon to open t

    I do my job to the computer on a MAC book PRO. I want to create a document using Pages and then convert the document to PDF and send a group email. I want to send the PDF using the pdf for each receiver icon must click the icon to open the document. My problem is the document does not show the icon, but rather the document is already open. I spoke with 2 Apple. 'Experts' care and can help me. Can someone tell me what to do?

    It's a question of how the recipients e-mail programs deal with attachments. Many e-mail programs will open all the files they can handle, including files jpg and PDF, by default, and if the recipient has not changed that there is nothing you can do about it. The only solution is to the compress first, then it will be delivered as an attachment, allowing the recipient to decompress and open it.

  • I want to create a 2 cells in demand for numbers, the 1st cell is a dropdown menu with items of text, when choosing an item, that it would be represented by a numeric value in the other cell. How can I do?

    I want to create a 2 cells in demand for numbers, the 1st cell is a dropdown menu with items of text, when choosing an item, that it would be represented by a numeric value in the other cell. How can I do?

    You can use vlookup() like this:

    (1) crate a table like this:

    the first line is a heading row

    the first column contains the same list of items in the context menu

    the second column contains the corresponding values

    name of the table 'value '.

    In another table (where the pop-up menu), you can use the table of choice of 'Value' like this:

    create a drop-down list in cell B1

    Select cell C1 and type (or copy and paste) the formula:

    = VLOOKUP (B1, Value::A:B, 2, 0)

    short hand for this is:

    C1 = VLOOKUP (B1, Value::A:B, 2, 0)

    now change the pop-up to display the value in the change of cell C1

  • I want to create an interactive page or file in Muse for anyone to connect and enter information, close and someone else can do the same thing, etc.  Is this possible?

    I want to create an interactive page or file in Muse for anyone to connect and enter information, close and someone else can do the same thing, etc.  Is this possible?  I want to have spaces at least 10 names to register.  These people need to log on to this page or file to use it or to see it.

    Help with the help of Adobe Muse CC

    Impossible to establish such a thing with the HTML and the CSS just as Muse creates it. You need a dynamic system like Wordpress, Joomla, or the plans Business Catalyst paid Typo 3 etc...

    Mylenium

  • I am very new to the software online, please bear with me.  My question is this: I want to create my own designs I want to use for the manufacture of silk scarves.  I have to provide these designs of production of silk professional so they

    I am very new to the software online, please bear with me.  My question is this: I want to create my own designs I want to use for the manufacture of silk scarves.  I'll have to provide professional silk production houses these designs so that they can use my design patterns to create these scarves in silk for retail customers.  What application Adobe should I consider, and I can get a first experimental?  Thanks a lot for your help.  Looking forward to your response.  Best regards, Sunaura

    Hello

    You can try to use Illustrator or Indesign.

    Desktop publishing software | Free download Adobe InDesign CC trial

    Hope that helps!

    Kind regards

    Sheena

  • I want to create an image of the browser for my site in Muse

    I want to create an image or some sort of file to the browser in the Muse who will fill the whole browser, screen, without losing quality when it is used as the fill for the browser and will not slow down is the site of Muse, I am trying to build.

    I use the basic dimensions which has a Muse to open a new file, which I believe is 960 width and height 500, but I could finish by using a width and a height, but for now I'm just starting with the height and width of base.

    1. What is the best way to do it?

    2 should. What size, dimensions, I use?

    3 should. the number of pixels per inch I use?

    I want the image to the black start and quickly fade in blue in the Center, leaving the sizable part of the blue Center, in a circle.

    How can I do this?

    If there is a way to do this in Muse without having to create an image, I would like to know how.

    Hey noelb8402969,

    Here are a few points to answer your question

    (1) - to fill the full browser with a photo - you can use this image browser fill.

    (2) - the quality of the image will remain the same, will not be carried out is not stretched.

    (3) - If you put a strong image browser will certainly be respected take time to load.

    And -I want the image to the black start and quickly fade in blue in the Center, leaving the sizable part of the blue Center, in a circle

    S ' Please create animation in Flash pro or edge animate and import it into the Muse.

    Kind regards

    Nitin

  • I want to create a new look for our website using Muse and move the hosting of GoDaddy for Business Catalyst. How can I publish my new Muse on exsiting URL design and change hosting?

    you want to create a new look for our website using Muse and move the hosting of GoDaddy for Business Catalyst. How can I publish my new Muse on exsiting URL design and change hosting? @@

    Hi love,

    You can publish your Business Catalyst, simply open your file of muse and select files-> publish.

    Please refer to this tutorial:- publish your site with Adobe Web Hosting | Learn the Muse | Adobe TV

    In addition, once your site is published, you can add your domain to your site hosted on BusinessCatalyst.

    Please refer to this tutorial to add your domain name:- http://helpx.adobe.com/business-catalyst/using/change-site-domain.html

    Hope this helps

    Kind regards

    Rohit Nair

Maybe you are looking for

  • VAP 1.1.19 error installation on Vista Ultimate - GetProfString is broken

    I have an A300-1i4 with Vista Ultimate 32 bit as OS. And when trying to install the package of value-added 1.1.19 I get the following error message "GetProfString is down..." Any idea or suggestion to this incident? Thank you.

  • Continious beep at boot by Satellite L350-235

    Hello world I have a problem on one of our Toshiba. It gives me now a Continious beep when starting the machine after having given in the bootpw.If I remove the battery and plug it back it starts normally. But after the next reboot, the problem recur

  • T430s card reader cannot read the SDHC 16 GB card

    My t430s cannot read 16 GB SDHC card that I use in my camera. Card is formatted in FAT32. Additional audit, the ricoh card reader, that I tried to put a 4 GB SDHC card and he was able to read, so I guess it's a driver issue I would be solved since th

  • OfficeJet 4500 G510a

    I downloaded the last software package on the site of HP for Windows 8 for the OfficeJet 4500. I ran the software and I can print successfully. However, the solution Center says that the installation was not complete. When I try to add a device, I am

  • both Ctrl keys stop working on R61i

    Hi, this is my first post. I tried the search function, but couldn't find the answer. I've owned several ThinkPads since the R30 and they have always been reliable. (My wife and I still have this R30 more 3 R40s and 2 R61s) R61i my wife developed a p