Subject Can't EXECUTE BLOCK
Author Steve Miller
When we execute the following code, which is in a larger stored
procedure, we get an Invalid Token error on BLOCK. It's probably a
stupid error, but we're new to Firebird, and can't figure what we're
doing wrong.

Steve

--------------------------------------------------------
EXECUTE BLOCK
(inClassName VARCHAR(31) = :vClassName, inId INT =:inNewId)
AS
DECLARE VARIABLE vRecId INT;
DECLARE VARIABLE vNewId INT;
DECLARE VARIABLE vDummyId INT;
DECLARE VARIABLE vDummyGuid CHAR(16) CHARACTER SET OCTETS;
DECLARE VARIABLE vNewTimeStamp INT;
DECLARE VARIABLE vS VARCHAR(100);
BEGIN
vS = 'SELECT FIRST 1 Id FROM ' || inClassName || 'ORDER BY Id;';
EXECUTE STATEMENT vS INTO :vRecId;

WHILE (vRecId IS NOT NULL)
DO BEGIN
EXECUTE PROCEDURE CreateObject_StText (0, vRecId, inId, null)
RETURNING_VALUES :vNewId, :vDummyGuid, :vNewTimeStamp;
vS = 'SELECT FIRST 1 Id FROM ' || inClassName || 'WHERE Id > '
|| vRecId || ' ORDER BY Id;';
EXECUTE STATEMENT vS INTO :vRecId;
END
END