Problem in creating function and it is too much urgent!!

I am a new to Oracle function,
And i am facing the following problem,plz make reply.......
CREATE OR REPLACE FUNCTION
get_working_period(JOINING_DATE IN DATE,EMPLOYEE_ID IN VARCHAR2)
RETURN date is
STATUS date;
ID varchar2(10);
PSTATUS DATE;
BEGIN
Select JOINING_DATE
into STATUS
from EMPLOYEE
where ID=EMPLOYEE_ID;
IF STATUS<SYSDATE
THEN
PSTATUS:=(SYSDATE-STATUS);[Problem is here,is it correct or any other way,plz reply]     
END IF;     
RETURN PSTATUS;
END get_working_period;
Regards --
Mamun

[Problem is here,is it correct or any other way,plz reply] One thing I hate is looking at other people's code and trying to understand what they mean. Particularly when its author is "a new to Oracle function" and so I can't rely on them understanding the conventions. It would be nice if people just told us what their code was supposed to do.
From the name of the function - get_working_period - I presume your trying to derive the number of days the given employee has been working for the company. The clue there is number of days. That's a numeric data type not a date. So PSTATUS ought to be a NUMBER and your function ought to return a NUMBER.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/

Similar Messages

  • I was playing candy crush and I had too much problem with my bill your charge too much I want to know what is the problem with this game cost

    HELLO
    I was playing candy crush and I had too much problem with my bill your charge too much I want to know what is the problem with this game cost

    Take it up with iTunes Support - we are not Apple here, we are just users like you:
    http://www.apple.com/support/itunes/ww/
    Cheers,
    GB

  • I was copying files to my time capsule when it crashed when it was almost finished. Now I am stuck with a light grey folder I can not delete. I would´t care if it wasn´t for the fact the folder is 1 TB size and takes up too much space. I ha

    I was copying files to my time capsule when it crashed when it was almost finished. Now I am stuck with a light grey folder I can not delete. I would´t care if it wasn´t for the fact the folder is 1 TB size and takes up too much space. I have tried turning on and of Hiding Files in Finder and what not with no success. So, how do I delete this folder. Remember, I am not extremely familiar with technical terms.

    I recommend you erase the TC.. it is the easiest and fastest solution.
    In Airport utility open the disk tab and select erase.. choose quick erase.. it will take less than 1min.
    Start again but copy files in small amounts.

  • HP2050 prints darker than photo on my computer...and uses WAY too much ink. HELP.

    and uses WAY too much ink.  HELP.

    Regarding the USB, see if zapping the PRAM helps.
    Regarding your storage space check out the following: 
    HD Space Checkers:
    Disk Inventory X (FREE)
    WhatSize (SHAREWARE)
    OmniDiskSweeper (FREE)
    GrandPerspective (FREE - donation)
    Mac Performance Guide
    Slimming your hard drive
    ===============
    Quick fix How To Quickly Free Up Hard Drive Space on Mac OS
    http://www.youtube.com/watch?v=fO-mlLApEuk

  • HT4528 I forgot my passcode for my iPhone and I had too much content to back it up in iCloud. How can I unlock my phone without having to restore it?

    I forgot my passcode for my iPhone and I had too much content to back it up in iCloud. How can I unlock my phone without having to restore it? I don't want to lose all my contacts and messages.

    You can't. The ONLY solution is to restore the device. If there were an easy way around the passcode lock, it wouldn't serve much purpose, would it?

  • Why my iphone 4s getting hot and bettery drains too much fast ??

    I Have iphone 4s and it is a big peoblem for me now because its bettery drains too much fast and it becomes too much hot after some time. I am too much worried about that. I dnt knw what can i do now with that. Please help me in this matter

    The battery can be too much used.  There are a number of ways to help batter life from too much draining.
    First, you might want to have an Apple technician run a diagnostic on the battery to see if it is either bad, or consumed.  Consumed meaning the battery has lived its life.  Batteries are like tires, they will run out sooner or later until it needs to be serviced.
    Second, you can preserve battery life by turning your brightness down, You can turn off background app refreshes, your some location services off, turn some notifications off that you might get regularly that you don't really need, you can also change email setting to get manually rather then pushed from the email server, lastly you can turn off WiFi and Bluetooth when not around a WiFi network or a Bluetooth device. 
    Good luck!

  • Problem during creating delivary and PGI

    Hello Friends,
    I am facing a problem in creating the Delivary document.
    The error is "date in item 000010 of document does not exist"
    Please help me out.
    With Regards
    Sharan

    Are you sure you posted in the correct forum? if it's related enterprise services and you're having problem with one of them, please clarify. thanks.

  • Initramfs too slow and ISR taking too much time !

    On my SMP (2 core with 10siblings each) platform i have a PCIe deivce which is a video card which does DMA transfers to the application buffers.
    This works fine with suse13.1 installed on a SSD drive.
    When i took the whole image and created it as a initramfs and running from it (w/o any hdd) the whole system is very slow and i am seeing PCIe ISRs taking too much time and hecne the driver is failing !
    any help on this is much appreciated.
    there is a first initramfs iage which is the usual initrd the opensuse installs and i patched it to unpack the second initramfs (full rootfs of 1.8GB) in to RAM (32GB) as tmpfs and exec_init from it.
    Last edited by Abhayadev S (2015-05-21 16:28:38)

    Abhayadev S,
    Although your problem definitely looks very interesting, we can't help with issues with suse linux.
    Or are you considering to test archlinux on that machine ?

  • 2011 Macbook Pro suddenly says no space available on start-up disk (plenty available) and USB drawing too much power (only charging phone). What's going on with my computer? No longer able to charge my iPhone 5.

    Hi, all.
    Two days ago I was using my computer, a 2011 Macbook Pro, and suddenly got the error message reading "Your Mac OS X startup disk has no more space available for application memory. To avoid problems with your computer, quit any applications you are not using. Closing windows and removing files from your startup disk will also help."
    I was only using Google Chrome, nothing was running in the background, and I have 443 of 449.25 GB available (this is after clean-up I conducted after receiving the error message, but probably cleaned up less than 25 GB), so there should be no shortage of space. However, the message kept popping up and I deleted a few files and eventually it went away and hasn't reappeared.
    However, last night and then again this morning I have been getting the error message that my USB drive is pulling too much power and has been disable. All that was plugged in was my iPhone 5 on the charger and my computer is also on its charger, so I don't know why this would be an issue, either. I have always charged my phone this way and never had a problem until today.
    I haven't been able to charge my phone since. What's going on with my computer?

    Regarding the USB, see if zapping the PRAM helps.
    Regarding your storage space check out the following: 
    HD Space Checkers:
    Disk Inventory X (FREE)
    WhatSize (SHAREWARE)
    OmniDiskSweeper (FREE)
    GrandPerspective (FREE - donation)
    Mac Performance Guide
    Slimming your hard drive
    ===============
    Quick fix How To Quickly Free Up Hard Drive Space on Mac OS
    http://www.youtube.com/watch?v=fO-mlLApEuk

  • All pictures in Photos on Mac syncing with Photos on iPhone and taking up too much space

    Since I downloaded Photos on my MacBook Pro, all the pictures that I had in iPhotos are not showing up on Photos on my laptop AND my iPhone. I used to be able to choose which iPhoto albums to sync with my iPhone and would prefer to do that again. It is taking up way too much space to have them all synced to my phone. Any idea how to choose which pictures I want available on my phone???

    Before the migration to Photos on laptop, I would go to iTunes, Photos, Sync Photos, Selected Albums, and then choose the albums from iPhoto to sync to phone.
    Since I had the problem with all of the photos syncing to iPhone, I un-checked Sync, but they were all still showing up on iPhone.
    I just looked at iTunes and saw this message:
    When I looked last week, the "copy from _______" was not an option. Now I am able to choose the iPhoto albums that I want to sync just as I was before.
    I still don't know why they were syncing when I didn't have that option selected, but it appears Apple has fixed the issue I was having.
    I guess I will continue to use iPhoto rather than Photos on my laptop to avoid this issue again.
    Thank you for your help!!!!

  • Camera connector and Samsung ST1000 - "too much power"?

    I purchased my iPad primarily to take on an overseas holiday so that I could access my email; and
    (ii) Download and manage photos off my Samsung St1000 digital camera.
    I also purchased the camera connector. However, whenever I try and connect the camera via USB, I get a message that the "accessory is unavaile: The attached accessory uses too much power" and it won't let me access the photos to copy them across.
    Any suggestions as to how I get around this problem?

    Is the battery in the camera fully charged? Googling says the camera takes a micro SD card. There might be adopters that will allow putting the micro SD card in an adopter so you can use the camera connection kit SD card reader. Or you might be able to buy a USB micro
    card reader and plug it into the camera connection kit USB connector.

  • Problem In creating link between info source to DSO(Urgent)

    Dear Experts,
    I am facing an problem in creating an link between info source and DSO.My problem is: I am actually loading data from R/3 into two data sources 2lis_01_s951 and 2lis_01_s952 there is a need for me to calcualte revenue % i.e diving revenue by qty from different data sources so i created one Info Source for 2 data sources,So i am facing a problem in creating an link from Info Source to DSO.Is there any other way to solve this problem.
    Points will be awarded.
    Regards,
    Shivu.

    Shivu,
    I’m suggesting either of the following 2 solutions.  Both of them require some abap programming.
    A. Permanently store calculation result in DSO :
    A1) You’ll need to decide which of the 2 DSOs you want to store the result of the % calculation, then add a new infoobject for that purpose;
    A2) Load ALL the data into the DSO that will NOT store the result of the % calculation; let’s call this DSO “DSO1”.  The data records in this DSO will be retrieved later on when loading the other DSO;
    A3) For the DSO that will store the result of the % calculation (let’s call this DSO “DSO2”),  create a transformation rule (i.e. update rule) that will SELECT the related data record from DSO1 and carry out the calculation before storing the data record in DSO2 ( this can also be done in the Start Routine to loop through all the data records of a packet.)
    B. Carry out the calculation at query time :
    B1) Create a multiprovider (i.e. multicube or infoset) to combine your infocubes or DSOs together.  Keep in mind that a multicube works as a union of the infoproviders, while an Infoset works as a join of the infoproviders.
    B2) Create a formula in your query to calculate the %.
    Hope this helps.

  • How do I get rid of an album  imported accidentally and taking up too much space

    How do I get rid of a photo album imported accidentally  which is taking too much space

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • Photoshop Elements 8 (and 7) crash too much in Windows 7

    Photoshop Elements 8 and 7 have a terrible crash problem in Windows 7 and
    also did in Windows Vista.  It seems to happen when going from the editor
    back to the organizer (after an edit session).  Am I doing something
    wrong?  This is a terrible problem.  I love the Photoshop Elements
    editor and the organizer but can't stand this crashing!

    Thanks, Dean...
    It looks like I might have found part of the problem.  I've followed some other advice on here on eliminating the welcome screen by using a short cut directly to the organizer.  However, it is more unstable for some reason when calling the editor from the organizer after loading it that way.
    I went back and loaded the program through the welcome screen and it did much better.  That's kind of strange to me.
    Thanks for offering to help.
    Jim

  • Jack and oss2jack consume too much memory

    This is my free output when I load jack and oss2jack at startup:
    total used free shared buffers cached
    Mem: 250148 244720 5428 0 5160 67224
    -/+ buffers/cache: 172336 77812
    Swap: 2449860 66048 2383812
    A check in top reveals that jack and oss2jack are the main culprits.
    Because of this, I cannot load hydrogen with the ns_kit7free samples (which is 200MB worth of .wav files). It terminates (probably due to trying to access too much memory) when I attempt to switch the drumkit to ns_kit7free. I have managed to load it before, when I was just using ALSA directly. Is there any way to reduce the memory consumption of jack and oss2jack?
    I have increased my swap space to > 2GB (as seen in the free output) but it doesn't help.

    jonathantan86 wrote:From top's output jack took up 2/3rd of the memory used. About adding more memory, well...it's a laptop so it's difficult to add memory.
    Well, if this can't be solved and you don't have to use ALSA, try OSS/Commercial (wiki); it has a virtual mixer in kernel-space and supports up to 32 sound output streams

Maybe you are looking for

  • How do I convert multiple pages into one for printing?

    I have a folder with a bunch of certificates, (different names) I would like to make into one file for printing.. how do I do that?

  • Ntfs external hard drives and fat32 4gb flash drive not able to unmount

    Hi everyone,      I have a bit of a headache here. I have two external hard drives, one is 1TB and the other is 500GB, both are NTFS format. I am using them on my macbook pro at this point because my windows 7 desktop appears to have crashed (still l

  • I lost my OS X how to get it back

    I lost my OX S how to get it back

  • Host commands

    I've create the HOST procedure as described in the asktom web page e.i. create or replace procedure host ( cmd in varchar2 ) as status number; begin dbms_pipe.pack_message( cmd ); status := dbms_pipe.send_message( 'HOST_PIPE' ); if ( status <> 0 ) th

  • Iphone 4 calendar closes after going forward three months

    Hi there, I am puzzled by the fact that when I use the calendar on my iphone, I can only look three months in advance. If I click to go forward another month, the application closes and returns me to the home screen. Is there a way that I can set thi