Solved

PL/SQL: ORA-00917:missing comma

Posted on 2010-08-20
4
1,715 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

776 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