Solved

PL/SQL: ORA-00917:missing comma

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Function to return one result based on data in first query 11 64
Oracle collections 15 53
Dbms_job.change procedure 16 36
DB Shutdown Automatically 11 32
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

734 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