Subject Re: [firebird-support] Create procedure -- newbie coming from ms sql server
Author Tim Ledgerwood
Hi,

Welcome to a decent database. :-)

Unlike SQL Server and Sybase (SQL Server was originally developed by
Sybase), you cannot just do a "select *" in a Stored Procedure in Interbase
or Firebird.

(although - note for the Powers that Be - this is something I would like to
see in FB if possible)

As far as documentation goes, you should download the Interbase
documentation off either the IBPhoenix web site, or the Source Forge Web
site. If you can't find it, email me directly, and I'll email you the PDF
files. The documentation is very good, IMHO.

You have to put your selected fields into return parameters. So your Stored
Procedure should look something like the following :

CREATE PROCEDURE FirstProcedure
RETURNS
(FirstName VARCHAR (XXX))
AS
BEGIN
FOR select FirstName from TBLMARTIN
INTO
:FirstName
DO
BEGIN
SUSPEND;
END
END



At 04:42 AM 06/19/2003 +0000, you wrote:

>Hi,
>
> This is going to sound like a real dumb question to tou probabally.
>Firstly, my background is in ms sql server, and I have been looking
>at firebird for the first time today.
>So I manged to create a table and populate it wil data.. hooray..
>
>CREATE TABLE TBLMARTIN (
> FIELD1 SMALLINT,
> FIRSTNAME VARCHAR (50) CHARACTER SET WIN1251 COLLATE WIN1251);
>
>insert into TBLMARTIN (FIELD1,Firstname) values
>(1,'martin') /*several time*/
>
>next I wrote a simple select statement and again it worked.
>
>select FirstName from TBLMARTIN
>
>then a decieded to encapsulate my select query into a stored
>procedure. This is where I hit real problems.
>I would have expected the following to work
>
>CREATE PROCEDURE FirstProcedure
>AS
>BEGIN
> select FirstName from TBLMARTIN;
>END
>
>but it doesn't.
>
>I have a million more questions about firebird and finding
>documentation is proving troublesome.
>
>Can anybody please point me to some tutorials that will help me
>accomplish tasks similar to above such as writing tiggers,udf's,
>views ect..
>
>any help i appreciated.
>
>cheers
>
>martin.
>
>
>
>
>
>
>
>
>To unsubscribe from this group, send an email to:
>firebird-support-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.489 / Virus Database: 288 - Release Date: 06/10/2003


[Non-text portions of this message have been removed]