Thanks Dennis & Rachel,

 

I tried both ideas and the SELECT Count worked best for my purposes.  I
have to remember to utilize that command more often.

 

Jim

 

 

________________________________

From: [email protected] [mailto:[email protected]] On Behalf Of Dennis
McGrath
Sent: Monday, August 24, 2009 10:01 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: [No Subject]

 

I do not believe IF can take a select statement.

 

Instead use

SELECT COUNT(*) into vCount FROM PART_RELATE where Partnum = .
vPartChoice and limit = 1

IF Vcount = 0 then

    -- put not found code here

 

ELSE

    -- put found code here

ENDIF

 

Dennis McGrath

 

________________________________

From: [email protected] [mailto:[email protected]] On Behalf Of Jim
Belisle
Sent: Monday, August 24, 2009 9:44 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - [No Subject]

 

I get an error for the below command 'Syntax is incorrect for the
command IF'

vPartChoice is defined prior to this statement and comes up correctly
when I SHOW VAR.

PART_RELATE is a table and the column names I am using are correct.

 

SET VAR vPartnew TEXT = NULL

IF vPartChoice = (SELECT Partnum FROM PART_RELATE) THEN +

    SET VAR vPartnew = Partrelate FROM PART_RELATE +

    WHERE Partnum = .vPartchoice

    SET VAR VFormMode = 'EDIT'

    EDIT USING KPRAssyPartGrid WHERE Assembly# = .vPartnew +

    ORDER BY PartNum

ELSE

    SET VAR VFormMode = 'EDIT'

    EDIT USING KPRAssyPartGrid WHERE Assembly# = (.vPartchoice) +

    ORDER BY PartNum

ENDIF

 

Jim

 

Reply via email to