Solved

PL/SQL: ORA-00917:missing comma

Posted on 2010-08-20
4
1,736 Views
Last Modified: 2013-12-07
I get the following error when I run the procedure below:

PL/SQL: ORA-00917:missing comma

All my commas are in place so I don't know why I get the error.
CREATE OR REPLACE PROCEDURE SP_INSERT_DUE_INFO
(
    CASE_NUMBER IN DATE_DUE_INFO_TBL.CASE_NUMBER%TYPE,
    DUE_DATE  IN DATE_DUE_INFO_TBL.DUE_DATE%TYPE,
    DESCRIPTION IN DATE_DUE_INFO_TBL.DESCRIPTION%TYPE
)

AS
BEGIN

    INSERT INTO DATE_DUE_INFO_TBL
            (
                CASE_NUMBER,
                DUE_DATE,
                DESCRIPTION,
                ID_KEY      
            )    
    VALUES
            (
                CASE_NUMBER,
                DUE_DATE,
                DESCRIPTION,
                DATEDUEINFO_SEQ.nextval FROM DUAL
            );
            
        COMMIT;
END SP_INSERT_DUE_INFO;
/

Open in new window

0
Comment
Question by:Isaac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 500 total points
ID: 33488966
CREATE OR REPLACE PROCEDURE SP_INSERT_DUE_INFO
(
    CASE_NUMBER IN DATE_DUE_INFO_TBL.CASE_NUMBER%TYPE,
    DUE_DATE  IN DATE_DUE_INFO_TBL.DUE_DATE%TYPE,
    DESCRIPTION IN DATE_DUE_INFO_TBL.DESCRIPTION%TYPE
)

AS
BEGIN

    INSERT INTO DATE_DUE_INFO_TBL
            (
                CASE_NUMBER,
                DUE_DATE,
                DESCRIPTION,
                ID_KEY      
            )    
    SELECT
                CASE_NUMBER,
                DUE_DATE,
                DESCRIPTION,
                DATEDUEINFO_SEQ.nextval FROM DUAL
            ;
           
        COMMIT;
END SP_INSERT_DUE_INFO;
/
0
 
LVL 2

Expert Comment

by:Subramanyeswara
ID: 33489015
Remove FROM dual in values and run the code:

CREATE OR REPLACE PROCEDURE SP_INSERT_DUE_INFO
(
    CASE_NUMBER IN DATE_DUE_INFO_TBL.CASE_NUMBER%TYPE,
    DUE_DATE  IN DATE_DUE_INFO_TBL.DUE_DATE%TYPE,
    DESCRIPTION IN DATE_DUE_INFO_TBL.DESCRIPTION%TYPE
)

AS
BEGIN

    INSERT INTO DATE_DUE_INFO_TBL
            (
                CASE_NUMBER,
                DUE_DATE,
                DESCRIPTION,
                ID_KEY      
            )    
    VALUES
            (
                CASE_NUMBER,
                DUE_DATE,
                DESCRIPTION,
                DATEDUEINFO_SEQ.nextval  
            );
           
        COMMIT;
END SP_INSERT_DUE_INFO;
0
 
LVL 2

Expert Comment

by:gnar
ID: 33489058
Didn't think you needed the "FROM DUAL" in an insert statement
0
 
LVL 2

Expert Comment

by:Subramanyeswara
ID: 33490267
yes, we need  "from dual" .Thanks!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question