-2

I have tried these:

1.if (EXEC SQL EXIST SELECT ...)
2.EXEC SQL IF EXIST SELECT ...

but none of these work,any help?

Tee
  • 91
  • 2
  • 9

1 Answers1

1

Select the count and check whether it is zero. Something along this line:

int a;
EXEC SQL SELECT count(*) INTO :a
         FROM some_table
         WHERE some_condition;
if (a != 0)...
Peter Pei Guo
  • 7,770
  • 18
  • 35
  • 54