Subject | Re: [Firebird-Architect] Re: Indexed Views |
---|---|
Author | Alexander Klenin |
Post date | 2004-12-22T14:08:36Z |
> > EXECUTE BLOCK (a INTEGER, b VARCHAR(10)) RETURNS (id INTEGER) ASoops...
> > BEGIN
> > id = gen_id(my_generator, 1);
> > INSERT INTO my_table (col_id, col_a, col_b) VALUES (:id, :a, :b)
> SUSPEND;
> !!! ;)
well, this gives some weight to a proposal to throw exception on
SELECT from procedures without SUSPEND -- for I have made such mistake
more than once.
> > ... and it even includes defaults, as inThen perhaps so should be said in the Firedird roadmap document, which
> > EXECUTE BLOCK (a INTEGER = 10, b VARCHAR(10) = 'abc')
>
> No, EXECUTE BLOCK don't have default parameters, but stored
> procedures have it.
> If you need default parameters with EXECUTE BLOCK just use
> variables, i.e.
>
> EXECUTE BLOCK
> AS
> declare a INTEGER = 10;
> declare b VARCHAR(10) = 'abc';
> ...
now contains the following:
>EXECUTE BLOCK syntaxexecution of an unnamed >block of procedural language code, consisting
>Proposed Release: 2.0
>Vlad Horsun and others are developing a syntax to allow DSQL
of a BEGIN...END block headed by an <EXECUTE BLOCK statement.
>Syntax pattern:Notice the 'param datatype = ?' parts.
>EXECUTE BLOCK [ (param datatype = ?, param datatype = ?, ...) ]
> [ RETURNS (param datatype, param datatype, ...) } AS
> [DECLARE VARIABLE var datatype; ...]
> BEGIN
> ...
> END