Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2004
    Location
    VA
    Posts
    14

    Lightbulb Unanswered: PLS-00410: duplicate fields in RECORD,TABLE or argument list are

    I am new to PL/SQL...
    I tried to compile this function but got errors. Any help would be appreciated. Thank you!

    CREATE OR REPLACE FUNCTION f_get_info_c (v_contact_id IN NUMBER, v_num IN NUMBER)
    RETURN VARCHAR2
    AS
    v_lname VARCHAR2(50);
    v_fname VARCHAR2(30);
    v_num NUMBER;
    v_return VARCHAR2(100);

    BEGIN
    IF v_num = 1
    THEN
    SELECT contact_email
    INTO v_return
    FROM contact
    WHERE contact_id = v_contact_id ;
    END IF;

    IF v_num = 2
    THEN
    SELECT phone
    INTO v_return
    FROM xref_contact_phone
    WHERE contact_id = v_contact_id ;
    END IF;

    IF v_num = 3
    THEN
    SELECT contact_last_name
    INTO v_lname
    FROM contact
    WHERE contact_id = v_contact_id ;

    SELECT contact_first_name
    INTO v_fname
    FROM contact
    WHERE contact_id = v_contact_id ;

    SELECT v_lname||' '||v_fname
    INTO v_return
    FROM DUAL;
    END IF;

    RETURN v_return;

    END f_get_info_c;
    /

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I tried to compile this function but got errors.
    ERROR? What error?
    I don't see any error.
    My crystal ball is in the shop for repair, and I won't waste my time guessing the problem and/or the solution.
    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.

  3. #3
    Join Date
    Jan 2004
    Posts
    492
    You have a parameter named v_num , and you are trying to declare a local variable named v_num as well.

    The compiler cannot tell which v_num you are referring to.

    And for Anacedent:

    1) For someone who lives in So CAL you are the least laid back person I've ever seen.

    2) The Error was in the subject line if you took 3 secs longer to read rather than come up with yet another wonderful comeback

  4. #4
    Join Date
    Mar 2004
    Posts
    23

    Re: PLS-00410: duplicate fields in RECORD,TABLE or argument list are

    I might suggest for v_num = 3:

    IF v_num = 3
    THEN
    SELECT contact_first_name || ' ' || contact_last_name
    INTO v_return
    FROM contact
    WHERE contact_id = v_contact_id ;
    END IF;

    What happens if v_num is not 1,2 or 3?

  5. #5
    Join Date
    Jan 2004
    Location
    VA
    Posts
    14
    Thank you very much. It works beautifully now. Cheers

  6. #6
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482
    Originally posted by ss659
    You have a parameter named v_num , and you are trying to declare a local variable named v_num as well.

    The compiler cannot tell which v_num you are referring to.

    And for Anacedent:

    1) For someone who lives in So CAL you are the least laid back person I've ever seen.

    2) The Error was in the subject line if you took 3 secs longer to read rather than come up with yet another wonderful comeback
    To: ss659

    Anacedent is just tired from questions without detailed description of problem.

  7. #7
    Join Date
    Jan 2004
    Posts
    492
    Originally posted by ika
    To: ss659

    Anacedent is just tired from questions without detailed description of problem.

    I understand, but if he's too tired of reading them, it's more constructive to let someone else answer it than to tell someone to READ THE F***ING MANUAL. Its not like he's getting paid to answer, so I dont understand getting so pissed off? He chooses to participate in the forum so its of his own volition

    I'm not going to waste anymore space arguing about this - but the error code and message was clearly stated in the subject line.

  8. #8
    Join Date
    Jan 2004
    Location
    VA
    Posts
    14
    I appreciate everyone's generous help.
    Please don't get into any arguments whatsoever.
    It is not worth it. I got the help I need and
    that is great. Thank you all and TGIF!

Posting Permissions

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