Oracle - mettre à jour ou insérer

Solved
Hello,
from Oracle SQL Developer, I want to insert a row into a table if it does not exist; otherwise, I just want to update the row. Here is the query I used:

UPDATE TABLE SET ATTRIBUT1= 'value', ATTRIBUT2 = 'value', ATTRIBUT3 = 'value'
WHERE IDTABLE = 'value'
IF SQL%ROWCOUNT=0 INSERT INTO TABLE (IDTABLE, ATTRIBUT1, ATTRIBUT2, ATTRIBUT3)
VALUES ('value', 'value', 'value', 'value')

When I execute this query, it gives me an error: Unknown command

Configuration: Windows 7 / Firefox 11.0

4 answers

  1. Hello,

    I finally fixed the issue, I had to add a BEGIN at the beginning of the request and an END; at the end.

    Thanks a lot for your help.
    0