Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2013
    Posts
    41

    Unanswered: Getting Error in PL/SQL function !

    Hi,

    I'm writing a stored function called MAKE_EMAIL that will accept input arguments for first name and lastname and will return a varchar2 value containing the email address in the form of first initial of the firstname followed by the full last name followed by @hpu.edu.

    Ex: Calling select make_email('Edward','Souza')from dual would return the single value: 'esouza@hpu.edu'

    Please consider the following code for a function:

    Code:
    create or replace function MAKE_EMAIL(lastname varchar2(10),firstname varchar2(10))
     return VARCHAR 
    IS
    
          email VARCHAR2;
    
     BEGIN
    
     email := substr(lastname ,1,1)|| firstname || '@hpu.edu';
    RETURN email;
    
    END;
    /
    After running above function, I'm getting some errors. Please find the image of the errors as an attachment. Please let me know how can I remove these errors or anything wrong with above code?
    Attached Thumbnails Attached Thumbnails Error.png  

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Why do you think that opening a new topic (here's the original one) changes my mind? You are still trying to write code without knowing rules that apply here (some people call these rules "syntax"). I'd suggest you to stop coding and start reading.

  3. #3
    Join Date
    Apr 2013
    Posts
    41
    FYI , I have read and filled up the missing part of my code and in a better situation as compared to the last one.

    Anyways, if you don't want to help, please don't comment on my post from next time.

    I have already figured out my mistake. I was just expecting a quick help.

    Quote Originally Posted by Littlefoot View Post
    Why do you think that opening a new topic (here's the original one) changes my mind? You are still trying to write code without knowing rules that apply here (some people call these rules "syntax"). I'd suggest you to stop coding and start reading.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I have already figured out my mistake.
    THANKS for sharing your solution so others might benefit in the future.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Quote Originally Posted by Jack_Tauson_Sr View Post
    FYI , I have read and filled up the missing part of my code and in a better situation as compared to the last one.

    Anyways, if you don't want to help, please don't comment on my post from next time.

    I have already figured out my mistake. I was just expecting a quick help.
    In my opinion, you are just being lazy and want someone to write your homework.

    If that's all what you managed to "fill up" in a day, whoa, you really put a lot of effort into it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •