Is giving this error qdo try to add data in table - 00928. 00000 - "Missing SELECT keyword

Asked

Viewed 43 times

0

Is giving this error qdo try to add data in table - 00928. 00000 - "Missing SELECT keyword

INSERT INTO DEPT
(
DEPTNO, DNAME, LOC)
VALUES
(10, 'ACCOUNTING', 'NEW YORK');
(20, 'RESEARCH', 'DALLAS');
(30, 'SALES', 'CHICAGO');
(40, 'OPERATIONS', 'BOSTON');
  • 1

    use , to separate the list of values and not ;

  • Thanks Ricardo, thanks for the help....

1 answer

1

Your problem is you’re using ; as a value list separator, and the right thing is to use , (comma).

The ; in this case is working as finalizer of the command, so it error saying expect a SELECT ("Missing SELECT keyword").

View documentation: https://docs.microsoft.com/pt-br/sql/t-sql/statements/insert-transact-sql

In your example, it should be:

INSERT INTO DEPT ( DEPTNO, DNAME, LOC) VALUES 
(10, 'ACCOUNTING', 'NEW YORK'),
(20, 'RESEARCH', 'DALLAS'),
(30, 'SALES', 'CHICAGO'),
(40, 'OPERATIONS', 'BOSTON')

Browser other questions tagged

You are not signed in. Login or sign up in order to post.