ORA-00917: missing comma when insert not exist in oracle

aminvincent

I have query like this :

INSERT INTO KONTAK (IDKONTAK, NAMA, NOHP, ALAMAT, GROUPKONTAK_FK) VALUES 
(SQ_IDKONTAK.NEXTVAL, 'ANDIKA PRATAMA', '+6285226202202', 'JPR', '' WHERE NOT EXISTS
(SELECT * FROM KONTAK WHERE NAMA = 'AMIN'))

I want insert data to KONTAK table based on the values where not exist in KONTAK NAMA='AMIN'.

When I ran it I got error :

ORA-00917: missing comma

Any suggestion?

codenheim

If you are trying to do a conditional insert, then you can either use MERGE, or use something like this, assuming you want to insert 'ANDIKA PRATAMA' only if 'AMIN' is not already there (which doesn't make sense to me, but it seems to be your goal):

insert into table1(id1, col1, col2)
  select sequence1.nextval, 'VAL1', 'VAL2'
    from dual
    where not exists (select 1 from table1 where col1 = 'AMIN')

http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9014.htm

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

ORA-00917: missing comma when insert not exist in oracle

From Dev

Missing Comma, oracle ORA-00917

From Dev

C# {"ORA-00917: missing comma"} INSERT QUERY ERROR

From Dev

Please help - ORA-00917: missing comma insert error

From Dev

ORA-00917, missing comma

From Dev

ORA-00917, missing comma

From Dev

ORA-00917: Missing Comma SQL Oracle error

From Dev

ORA-00917: missing comma error

From Dev

ORA-00917 missing comma in Powershell

From Dev

sql oracle, error "PL/SQL: SQL Statement ignored" and "PL/SQL: ORA-00917: missing comma"

From Dev

Error: ORA-00917: missing comma 00917. 00000 - "missing comma"

From Dev

ORA-00917 Missing Comma, but it isn't missing?

From Dev

java.sql.sqlexpcetion:ORA-00917:missing comma

From Java

Missing comma in Oracle insert

From Dev

java.sql.SQLException: ORA-00917: missing comma while Inserting rows in a table

From Dev

java.sql.SQLException: ORA-00917: missing comma while Inserting rows in a table

From Dev

Oracle SQL Missing Comma

From Dev

Oracle Missing Comma

From Dev

Oracle SQL missing comma error

From Dev

Insert only when values does not exist in oracle sql

From Dev

Oracle SQL Plus: Error “ORA-00922: missing or invalid option” when creating user

From Dev

ORA-00907: missing right parenthesis when creating a table in Oracle 11G

From Dev

Oracle SQL Plus: Error “ORA-00922: missing or invalid option” when creating user

From Dev

Knowing when to insert a comma in ColdFusion

From Dev

ORACLE: ORA-02013: missing CONNECT keyword

From Dev

ORA-00936: missing expression distinct on oracle

From Dev

ORA-00936: missing expression oracle

From Dev

Oracle ORA-0095: missing keyword

From Dev

Insert comma in a string at a regular interval in oracle

Related Related

  1. 1

    ORA-00917: missing comma when insert not exist in oracle

  2. 2

    Missing Comma, oracle ORA-00917

  3. 3

    C# {"ORA-00917: missing comma"} INSERT QUERY ERROR

  4. 4

    Please help - ORA-00917: missing comma insert error

  5. 5

    ORA-00917, missing comma

  6. 6

    ORA-00917, missing comma

  7. 7

    ORA-00917: Missing Comma SQL Oracle error

  8. 8

    ORA-00917: missing comma error

  9. 9

    ORA-00917 missing comma in Powershell

  10. 10

    sql oracle, error "PL/SQL: SQL Statement ignored" and "PL/SQL: ORA-00917: missing comma"

  11. 11

    Error: ORA-00917: missing comma 00917. 00000 - "missing comma"

  12. 12

    ORA-00917 Missing Comma, but it isn't missing?

  13. 13

    java.sql.sqlexpcetion:ORA-00917:missing comma

  14. 14

    Missing comma in Oracle insert

  15. 15

    java.sql.SQLException: ORA-00917: missing comma while Inserting rows in a table

  16. 16

    java.sql.SQLException: ORA-00917: missing comma while Inserting rows in a table

  17. 17

    Oracle SQL Missing Comma

  18. 18

    Oracle Missing Comma

  19. 19

    Oracle SQL missing comma error

  20. 20

    Insert only when values does not exist in oracle sql

  21. 21

    Oracle SQL Plus: Error “ORA-00922: missing or invalid option” when creating user

  22. 22

    ORA-00907: missing right parenthesis when creating a table in Oracle 11G

  23. 23

    Oracle SQL Plus: Error “ORA-00922: missing or invalid option” when creating user

  24. 24

    Knowing when to insert a comma in ColdFusion

  25. 25

    ORACLE: ORA-02013: missing CONNECT keyword

  26. 26

    ORA-00936: missing expression distinct on oracle

  27. 27

    ORA-00936: missing expression oracle

  28. 28

    Oracle ORA-0095: missing keyword

  29. 29

    Insert comma in a string at a regular interval in oracle

HotTag

Archive