Subject | Re: [firebird-support] Re: Generators and Stored Procedures |
---|---|
Author | Martijn Tonies |
Post date | 2005-06-17T21:25:14Z |
> > > >>CREATE PROCEDURE G (GNAME VARCHAR(31), GSTEP INTEGER)Read it again. The SQL to be execute CANNOT contain parameters.
> > > >> RETURNS (GVAL BIGINT) AS
> > > >>BEGIN
> > > >> EXECUTE STATEMENT 'SELECT GEN_ID(' || UPPER(:GNAME) || ', '
> > > >
> > > > || :GSTEP || ') FROM RDB$DATABASE'
> > > >
> > > >> INTO :GVAL;
> > > >>END
> > > >>
> > >
> > > Sure does it work, just tried it:
> >
> > My results are in line with the developer said.
> >
> > http://groups.yahoo.com/group/firebird-support/message/62039?
> > threaded=1
>
>
> I did get it to work, so I guess you can use parameters/variables.
However, when concatenating the SQL together, you CAN use
parameters, because their value will be in the resulting string-to-execute.
With regards,
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com