Larry, just curious, did you try this and find it was slow? I would think it 
would be pretty fast as RBASE has some fairly good optimization.

 

Ken

 

From: [email protected] [mailto:[email protected]] On Behalf Of Lawrence Lustig
Sent: Friday, June 24, 2011 11:17 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Issue with IFNULL and SET ZERO.

 

<< 

A not so elegant solution is to write a stored procedure to do the dirty work. 
Using cval(‘zero’) you can save the value of the set zero command, set zero off 
and do your calculation, which the stored procedure would return the result. 
After you are finished you can set zero back to the state it was in.

 

This assumes your update statement doesn’t depend on set zero on.

>> 

 

I don't consider this solution inelegant.  And I can handle the entire SET ZERO 
issue inside the stored procedure:

 

-- Stored Procedure

SET pZero = (CVAL('ZERO'))

SET ZERO OFF

-- Perform Calculation 

 

SET ZERO &pZero

CLEAR VAR pZero

 

The only problem with this solution is it's SLOW -- the stored procedure would 
be called on every update to the row.

--

Larry

Reply via email to