John, you can
SELECT COUNT(*) INTO vsCount FROM sections WHERE sno = .vsno
IF vsCount > 0 THEN
-- whatever
ENDIF

AFIK the IF statement does not allow embedded SELECT clauses in R:Base


John Docherty wrote:
I am wanting to base an IF statement on the existence of a number in a
table, however I receive the following error with my attempt, which is

IF vsnew IN (SELECT secno FROM sections WHERE sno=.vsno) THEN ….

-ERROR- Sub-SELECTs are not supported by this command. (2310)
I was wondering if the only way of achieving this to do a SELECT INTO (or
similar) to determine if any values exist that meet the criterion or, is
this possible, but my statement is incorrect ?

Any suggestions would be much appreciated.



Reply via email to