How to use if exists- if not exists in PL/SQL?

前端 未结 3 1246
情话喂你
情话喂你 2021-01-27 05:47

I am trying to convert if exists statement from SQL-Server to PL/SQL but having an error.

I am trying to check if NAME_1 doesn\'t exist in my table_1<

3条回答
  •  清歌不尽
    2021-01-27 06:36

    (answer given before the Oracle version and the error message were inserted into the question)

    As you can see here: IF-THEN-ELSE Statement, the syntax is different for Oracle

    IF condition THEN
       {...statements to execute when condition is TRUE...}
    ELSE
       {...statements to execute when condition is FALSE...}
    END IF;
    

    I.e., there is no BEGIN ... END block. Instead the statement ends with END IF

提交回复
热议问题