Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2011
    Posts
    3

    Question Unanswered: Error when trying to create a procedure in pl/sql

    Hi everyone I am new to this forum and I am having a problem when I try to create the following procedure:

    create or replace
    PROCEDURE BASKET_ADD_SP
    (P_IDBASKETITEM IN BB_BASKETITEM.IDBASKETITEM%TYPE, P_PROD_ID IN BB_BASKETITEM.IDPRODUCT%TYPE,
    P_PRICE IN BB_BASKETITEM.PRICE%TYPE, P_QTY IN BB_BASKETITEM.QUANTITY%TYPE,
    P_BKST_ID IN BB_BASKETITEM.IDBASKET%TYPE,
    P_SIZE IN BB_BASKETITEM.OPTION1%TYPE, P_FORM IN BB_BASKETITEM.OPTION2%TYPE) AS

    BEGIN
    INSERT INTO BB_BASKETITEM
    (IDBASKETITEM, IDPRODUCT, PRICE, QUANTITY, IDBASKET, OPTION1, OPTION2)
    VALUES(P_IDBASKETITEM, P_PROD_ID, P_PRICE, P_QTY, P_BSKT_ID, P_SIZE, P_FORM);
    END;

    *I am trying to add a row into the table BB_BASKETITEM table.
    Any help is appreciated! Sorry for the huge font!

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Error when trying to create a procedure in pl/sql
    ERROR? What Error?
    I don't see any error.
    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
    Apr 2011
    Posts
    3

    Sorry about that

    Here is the error:

    Error(9,53): PL/SQL: ORA-00984: column not allowed here

    and this is the line of code that gets highlighted with red squiggly lines:

    VALUES(P_IDBASKETITEM, P_PROD_ID, P_PRICE, P_QTY, P_BSKT_ID, P_SIZE, P_FORM);

  4. #4
    Join Date
    Mar 2007
    Posts
    623
    What about using the same variable name as in procedure declaration?
    Code:
    P_BKST_ID IN BB_BASKETITEM.IDBASKET%TYPE
    
    P_BSKT_ID
    are different ones.

  5. #5
    Join Date
    Apr 2011
    Posts
    3

    Thumbs up Thank You!

    flyboy,

    Thank you for your help! I didn't do exactly what you said but you were right, the variables didn't match.

Posting Permissions

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