Can you tell me how to execute the procedure?

create or replace get_dob
(ss_number varchar2,dob out date)
as
begin
select birth_dae
into dob
from person
where soc_sec_num=ss_num;
exception when no_data_found
error_notify(ss_num);
end;
the question is that when i want to execute this procedure,how can I use the command?
I try to use the "execute get_dob('wang');"in the sql/plus,but the system give me wrong information.

Errors:
1. You left out the word PROCEDURE after CREATE OR REPLACE.
2. You used ss_number in one place and ss_num in two others. These must be the same name.
3. You left out the word THEN after WHEN NO_DATA_FOUND.
Possible errors:
1. Is birth_dae spelled correctly? Or, should it be birth_date?
2. Is error_notify a user-defined procedure?
Additional suggestions:
1. It is better to use table_name.column_name%TYPE instead of specifying NUMBER, VARCHAR2, DATE, etc. for your parameters. That way if the column data types are changed in the future, you don't have to change your code.
2. You will need to SET SERVEROUTPUT ON and use DBMS_OUTPUT.PUT_LINE to display the contents of the variable that holds the value of the out parameter.
3. Please see suggested code for creation of procedure and execution of procedure below. I have included one row of test data so that some output will be displayed. I commented out the exception section, in order to test it, since I don't have your error_notify procedure.
SQL> -- test data:
SQL> CREATE TABLE person
  2    (birth_dae   DATE,
  3     soc_sec_num NUMBER)
  4  /
Table created.
SQL> INSERT INTO person
  2  VALUES (SYSDATE, '123456789')
  3  /
1 row created.
SQL> SELECT * FROM person
  2  /
BIRTH_DAE SOC_SEC_NUM
06-DEC-02   123456789
SQL>
SQL>
SQL> -- create procedure:
SQL> CREATE OR REPLACE PROCEDURE get_dob
  2    (ss_number IN  person.soc_sec_num%TYPE,
  3     dob       OUT person.birth_dae%TYPE)
  4  AS
  5  BEGIN
  6    SELECT birth_dae
  7    INTO      dob
  8    FROM      person
  9    WHERE  soc_sec_num = ss_number;
10  -- EXCEPTION
11  --  WHEN NO_DATA_FOUND THEN
12  --    error_notify (ss_number);
13  END get_dob;
14  /
Procedure created.
SQL> SHOW ERRORS
No errors.
SQL>
SQL>
SQL> -- execute procedure:
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
  2    v_dob DATE;
  3  BEGIN
  4    get_dob ('123456789', v_dob);
  5    DBMS_OUTPUT.PUT_LINE (v_dob);
  6  END;
  7  /
06-DEC-02
PL/SQL procedure successfully completed.

Similar Messages

  • Hi can you tell me how to remove the icons in safari on my iphone 4s?

    Hello, I am using an iphone 4s and when I tap on the Safari icon, the screen shows sites I have visited, how to I delete these icons.  I have tried soft close - top button and home button together, in settings>safari tapped on Clear Cookies and Data - to no avail. Settings>safari>advanced and under website data I was able to delete each one, but the icon continues to appear on the screen when I tapped on the Safari app.  I was also unable to type into the search box, the app closed.  Hope someone out there can help.

    Hi
    Thank you for taking the time to answer my query.  When I tap the bookmark at the bottom of the screen, it opens a screen with Allowed Sites and History when I tap either of them there is no option to delete, also there is no Favourites to tap after tapping the bookmark icon.  Each time I tap the Safari app, and try to type something into the address bar, the app closes and I am unable to access the internet although connected. Any suggestions, would resetting phone help?

  • Can you tell me how to get the Dreamweaver installer to initialize?

    To: Adobe Support
    The installer for the Dreamweaver trial will not initialize and the download advisor can't detect any problem. I used to have a subscription for an older version of Dreamweaver but wanted to check this version out before getting another subscription. The advizor packaged information about my system, and the token number is 40-39041-042922092012. Help please...TIA

    The message you sent requires that you verify that you
    are a real live human being and not a spam source, which has become a problem.
    To complete this verification, simply reply to this message and leave
    the subject line intact.
    The headers of the message sent from your address are shown below:
    From [email protected] Sat Sep 22 05:20:00 2012
    Received: from mail.sgaur.hosted.jivesoftware.com (209.46.39.252:2464 helo=mx-out4.sgvm2hosted.jiveland.com)
         by biz82.inmotionhosting.com with esmtps (TLSv1:AES256-SHA:256)
         (Exim 4.77)
         (envelope-from <[email protected]>)
         id 1TFOgd-0002Z8-L4
         for [email protected]; Sat, 22 Sep 2012 05:19:59 -0700
    Received: from adobe-vm-wa05.sgvm2hosted.jiveland.com (unknown 10.122.0.4)
         by mx-out4.sgvm2hosted.jiveland.com (Postfix) with ESMTP id 07AF1D05BE
         for <[email protected]>; Sat, 22 Sep 2012 06:19:57 -0600 (MDT)
    Date: Sat, 22 Sep 2012 06:19:56 -0600

  • I've been receiving an error message, "That the .itl file is locked, on a locked disc or you do not have write permission". Can someone tell me how to unlock the file or disc?

    I've been receiving an error message, "That the .itl file is locked, on a locked disc or you do not have write permission". Can someone tell me how to unlock the file or disc?

    theres no - in "itunes" its all one word
    try right clicking and running itunes as adminstrator or try on a different user account

  • My computer had a virus and had to be cleaned, but I had my Mozilla bookmarks in a Word file now located on my Desktop. There should be an easy way to drag the bookmarks to the new Mozilla. Can you tell me how in simple straightforward steps? Thanks.

    Question
    My computer had a virus and had to be cleaned, but I had my Mozilla bookmarks in a Word file now located on my Desktop. I have spent hours trying to drag those bookmarks to the new Mozilla. There should be an easy way to do this. Can you tell me how in simple straightforward steps? Thanks.

    If the Word file is a document file type (.doc), you may be able to save it as a .html file, then import that .html file into Firefox.
    In Word, open the .doc file containing the Bookmarks,
    *click File > Save As,
    *in the "Save in" box, choose a Folder or location on your hard drive to save the file where you can find it later,
    *in the "Save type as" box choose ".html",
    *in the "Filename box" enter "bookmarks.html" (without the quotation marks),
    *click "Save"
    Then follow the-edmeister's instruction in Firefox:
    *Bookmarks > Organize Bookmarks -> Import & Backup - Import HTML... = from an HTML file
    *See: http://support.mozilla.com/en-US/kb/Importing%20Bookmarks%20from%20an%20HTML%20File

  • HT1386 I recently bought a new laptop and installed itunes. I was trying to sychronize my ipad and iphone, but it seems that the itunes was unable to recognize the devices. Can you tell me how I can solve this problem?

    I recently bought a new laptop and installed itunes. I was trying to sychronize my ipad and iphone, but it seems that the itunes was unable to recognize the devices. Can you tell me how I can solve this problem?

    how new is the Notebook ?
    Also double check your firewalls and virus protection that they are not blocking any ports also make sure you are plugging in the fastest USB

  • Details: Numbers not translating an Excel document with column headings where the text is rotated counter clockwise 90 degrees with-in the cell.  Can you tell me how I can rotate the contents with-in a cell?

    Details: Numbers not translating an Excel document with column headings where the text is rotated counter clockwise 90 degrees with-in the cell.  Can you tell me how I can rotate the contents with-in a cell?

    Numbers does not have rotated text within cells.  You can place a text box over the cell that has rotated text but you cannot rotate text within a cell.

  • HT201441 Hi I bought a second-hand phone iphone4, I update the software when you want to activate the phone asked for my registration icloud I do not know what is the password for this registration, can you tell me how to go to the next step without such

    Hi I bought a second-hand phone iphone4, I update the software when you want to activate the phone asked for my registration icloud I do not know what is the password for this registration, can you tell me how to go to the next step without such registration in icloud
    my ICCID is 8935905000307066111

    Unfortunately, you cannot do very much with your phone unless you get assistance from the previous owner, they should either provide you with the password to unlock it or remove their account from the phone entirely remotely through iCloud.com > Find My Phone.

  • I would like to run the vi first and then press the safe button to write it to disk.i am sending you the vi. please can you tell me how can i correct this vi?

    i am running some vis in frames of sequence frome frame number 1 to frame 10.after this i would like to create one other vi with some strings and i want to save it to disk with a save button. i am opening,writing and closing the data.what i want is that a save button to write the file .moreover i would like to run the application first and then press the safe button to write it to disk.i am sending you the vi. please can you tell me how can i correct this vi?
    Attachments:
    savestrings.vi ‏80 KB

    Here's a picture of a while loop around part of your code. All it's doing is waiting to write until the user presses the save button. If you need it to do more, explain in more detail.
    Attachments:
    While_Loop.jpg ‏17 KB

  • I now have two iPads and have opened a new icloud account.  I need to change one of the ipads to the new account.  Can you tell me how to do that?

    I now have two iPads and have opened a new icloud account.  I need to change one of the ipads to the new account.  Can you tell me how to do that?

    Welcome to the Apple Community.
    settings > iCloud, scroll down and delete account. Re-enter the details of the new account.

  • I want to maintain Safari 10.6.8 on my computer and then install Maverick on a separate internal drive so I can run new FCPX software and maintain the older OS for my older software versions.  Can you tell me how please?

    I want to maintain Safari 10.6.8 on my computer and then install Maverick on a separate internal drive so I can run new FCPX software and maintain the older OS for my older software versions.  Can you tell me how please?
    I see an upgrade path from Safari but don't want to change that and would like to be able boot from Maverick when needed.
    Is this possible and how?
    Thank you!

    On the Apple site I see an upgrade path but not from scratch.  I will use my current systems and then it place a complete install of Maverick on the other drive to boot from?
    Thank you!

  • TS1702 I have downloaded and attempted to purchas the app "ForeFlight HD" for the iPad 2, however, when I put my credit card information into the app for purchase, I am told to contact iTunes support to complete the transaction. Can you tell me how to fix

    I have downloaded and attempted to purchas the app "ForeFlight HD" for the iPad 2, however, when I put my credit card information into the app for purchase, I am told to contact iTunes support to complete the transaction. Can you tell me how to fix this?

    Contact iTunes Support:
    http://www.apple.com/support/itunes/contact/

  • HT201302 Hi Please can you tell me how I sync my photos from my photo library to my pc?  I hve managed to sync those from different albums but the ones on my photo library are not copying over.

    Hi
    Please can you tell me how I sync my photos from my photo library to my Pc?  I have managed with all other photos but the ones on this album don't seem to be syncing?
    Please help!
    Thanks,
    Jane

    First check to be sure your comuter is 'Authorized'.
    Plug in your device and select it from the 'Devices' list in iTunes.
    You can manually manage the content from the Summary tab OR sync the tunes and other media from the other tabs (music, apps, photo's etc).
    You can sync different content to different Devices from the same iTunes library. I have 2 iPhones, multiple iPods, multile iPads etc all on the same library with different content on each device.
    MJ

  • Can you tell me how I can put the data of sql server into SAP to auto gener

    Dear all,
             Can you tell me how I can put the data of sql server into SAP to auto generate PR?
    Best regards,
    Merry zhang

    Many thanks ,it is ok now.

  • HT5661 How can I unlock my iphone from Iusacel (Mexico) I moved to Canada and the Iusacel company told me they cannot do it. Can you tell me how? I want to keep using my iphone.

    How can I unlock my iphone from Iusacel (Mexico) I moved to Canada and the Iusacel company told me they cannot do it. Can you tell me how? I want to keep using my iphone.

    The normal process is to request the unlock with the carrier.  They process it and pass it on to Apple to be applied to the Apple's iPhone database.  The carrier would then inform you when Apple has provisioned the unlock, and you would restore your iPhone as a new device in iTunes to apply the unlock (you would get a message at the end of that restore as new in iTunes indicating the unlock was successfully applied).  You could then restore your iPhone from backup to get everything back as it was.
    However, for some carriers, you seem to beed to complete the iTunes restore from within the country where they provide service.  Regardless, have you tried restoring as new in iTunes to see if it processes any provisioned unlock request?  Just be sure to backup the iPhone first, before restoring as new.

Maybe you are looking for

  • Photo won't open - but can see thumbnail

    Hello all, First off the bat, this is my mother's computer and I have no idea what to do with a mac, I've always used a PC. I've asked her about it & she's looked into it with me but we can find no answer. Mom had updated iPhoto to 5.0.4, and wanted

  • Restoring DPMDB 2012 SP1 to a New Server

    Greetings, I am in the middle of moving primary DPM servers.  This was not for the purpose of upgrading DPM.  We were running DPM 2012 SP1 on Server 2012, using a remote instance of SQL 2012.  Now, I am moving to a new DPM server (using DPM 2012 SP1

  • Not sure how to use Movie Maker with my HP TrueVision HD webcam

    I've never used Movie Maker before. When I fire it up and double-click Webcam video in the ribbon I get a splash screen saying "Please Start YouCam" I assume it is possible to make a video using the build-in webcam, and to save it to disk. I need som

  • Restrict application access based on IP address

    Hi! I am a newbie to Oracle Application Server, and I want to know if there is any way to restrict access to particular applications such as 'ascontrol' based on IP address. I am using Oracle Application Server 10g. Regards Drini

  • Error during display gif

    Hi guys, I am using apache tomcat. and working on windows 2000. i am working on a web project. i want to display a gif file. some of my gif file has extension GIF that is in capital letters. as windows is not case sensitive when i generate code to di