0

Here is a part code form my embedded SQL program

EXEC SQL IF EXISTS(SELECT * FROM table_name WHERE bool_condition)
BEGIN
...
END;

It gives the error

An unexpected token "IF EXISTS(SELECT * FROM table_name " was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "". SQLSTATE=42601

Can anyone tell what is wrong?

Damith
  • 62,401
  • 13
  • 102
  • 153
Vishal
  • 989
  • 2
  • 11
  • 19

1 Answers1

0
IF EXISTS(SELECT * FROM table_name WHERE bool_condition)
EXEC SQL
ELSE
' do something 
Damith
  • 62,401
  • 13
  • 102
  • 153