scalar subquery in if statement Condition in PL/SQL

后端 未结 3 1977
一生所求
一生所求 2021-01-23 06:50

I have an If Statement block similar to the below which is failing with the error - PLS-00103: Encountered the symbol \"SELECT\" when expecting one of the following....

3条回答
  •  迷失自我
    2021-01-23 07:12

    No, you can't use a SELECT in the way you want.

    In your example using CASE, you are not using a CASE "statement" -- you are using a CASE expression, which happens to be embedded within a SQL statement. You can use a subquery in that case because it's within the context of a SQL statement, not a procedural statement. You wouldn't be able to use a subquery like this in a procedural CASE statement.

提交回复
热议问题