Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PL/SQL: ORA-00917:missing comma

Posted on 2010-08-20
4
Medium Priority
?
1,811 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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ā€¦
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example, show how to take different types of Oracle backups using RMAN.
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

609 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