Subject Re: [firebird-support] Re: Create procedure -- newbie coming from ms sql server
Author peter@cyionics.com
Hi

It may be good if we could recommend some books to each other.

I'm pretty new to SQL too, having come from Mysql and only ever done simple things with Interbase.

When I get stuck I also look at
Mastering SQL by Martin Gruber , publisher Sybex, this is a hefty but useful book for me anyway

also Instant SQL Programming , Joe Celco, Wrox, much more of an introduction.

I wonder if anyone else might recommend some good books to help us all.


Rgds

Peter
Cyionics
----- Original Message -----
From: martindevroom
To: firebird-support@yahoogroups.com
Sent: Thursday, June 19, 2003 6:25 AM
Subject: [firebird-support] Re: Create procedure -- newbie coming from ms sql server


Hi tim,

Thanks for that and the quick response.
the stored procedure worked (you'll be amazed to know :) )
although i did find the syntax a little odd.

I am using EMS interbase/firebird manager to connect to the database.
I tried running the stored procedure in the sql editor by typing

EXECUTE FIRSTPROCEDURE

but it gave me an error. any clues??

I'm now going to attemp to run the procedure from asp, I've already
managed to make a connection :)

If I can't find them docs i'll email you from my work address as they
won't fit in hotmail i think.

cheers

martin.





--- In firebird-support@yahoogroups.com, Tim Ledgerwood <tim@s...>
wrote:
> 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]


Yahoo! Groups Sponsor



To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


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