8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:03:03 +01:00

Misc, adding example.

This commit is contained in:
robocop 2006-07-31 07:42:47 +00:00
parent c42fc0fffc
commit b43ad7ae16

View File

@ -127,3 +127,21 @@ II. If the stored procedure has special privileges on some objects, the
dynamic statement submitted in the EXECUTE STATEMENT string does not
inherit them. Privileges are restricted to those granted to the user who
is executing the procedure.
III. Even though EXECUTE STATEMENT is available in triggers and stored procedures
only, it's possible to call it directly from DSQL statements, using EXECUTE BLOCK
facility. Example:
set term ^;
execute block returns(i bigint) as
begin
execute statement 'select avg(rdb$relation_id)
from rdb$database' into :i;
suspend;
end^
set term ;^
However, for such contrived code, it's better to call EXECUTE BLOCK in a stored
procedure or to construct the query dynamically in the client side.
For information on EXECUTE BLOCK, see the README.execute_block document.