Subject Re: Newbie Questions
Author donjules2k
Hi,

Many thanks for your help much appreciated.

So to do a simply select, I must return values. Then how would a
stored procedure with multiple recordsets work? Or is this not an option?

--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@u...> wrote:
> Hi Jules,
>
> > I'm a fluent SQL Server user and am investigating Firebird and was
> > wondering if someone could help me with a couple of issues.
> >
> > 1) I'm trying to create a stored procedure as follows but it always
> > errors and won't compile. Any idea what is wrong?
> >
> > create procedure testproc as
> > begin
> > select * from testtable;
> > end
>
> With Firebird, you cannot just create procedures that return
> a resultset.
>
> If you want to create a SELECT-able procedure, that can be
> used like this:
>
> select * from testproc [(optional variables)]
>
> Then use something like:
>
> create procedure testproc returns (output1 integer, output2 integer)
> as begin
> for select column1, column2
> from testtable
> into :output1, :output2
> do suspend;
> end
>
> The "suspend" signals Firebird that it should wait with outputting rows
> of the cursor (FOR SELECT ... DO) until the client/caller fetches
> more rows.
>
> > 2) In Firebird what is the concept of "Domains"?
>
> Pretty much the same as "User Defined Types" in MSSQL Server.
> You can add a check constraint to Domains as well.
>
> > 3) What does the $ symbol mean in various table names? Is this just a
> > naming convention or does it have a specific function in firebird?
>
> The RDB$... are system tables.
>
> With regards,
>
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird, MySQL &
MS SQL
> Server.
> Upscene Productions
> http://www.upscene.com