Solved

PL/SQL: ORA-00917:missing comma

Posted on 2010-08-20
4
1,699 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
Comment Utility
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
Comment Utility
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
Comment Utility
Didn't think you needed the "FROM DUAL" in an insert statement
0
 
LVL 2

Expert Comment

by:Subramanyeswara
Comment Utility
yes, we need  "from dual" .Thanks!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now