Page 1 of 1

TZSQLProcessor + Return Field

Posted: 20.07.2022, 15:16
by amonteiro
Hi, i have a sql script in the Firebird 4 that is like it:

Code: Select all

EXECUTE BLOCK
RETURNS (EXISTE INTEGER)
AS
BEGIN
  EXISTE = 0;
  IF (EXISTS(SELECT 1 FROM RDB$PROCEDURES WHERE RDB$PROCEDURE_NAME = 'VEC_OBTERVERSAOEC')) THEN
     EXISTE = 1;
  SUSPEND;
END
I would like to run this sql and get the Field EXISTE in the returns. I try TZSQLProcessor but i don't know how do this. Someone know how i could do? Thanks.

Re: TZSQLProcessor + Return Field

Posted: 23.07.2022, 16:31
by marsupilami
Hmm - I am not sure but you might want to try using TZReadOnlyQuery. Put the execute block in the SQL property and call .Open. If that doesn't work, I think, it is impossible to execute this block.

Note: If you don't want to do more, you might want to simply do this:

Code: Select all

SELECT count(*) as EXISTE FROM RDB$PROCEDURES WHERE RDB$PROCEDURE_NAME = 'VEC_OBTERVERSAOEC'