Subject Re: [firebird-support] Token unknown - SUSPEND/END
Author Martijn Tonies
Hi,

SELECT ... INTO ???

Read the documentation on using SELECT in a stored procedure.


With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com

> Hello,
> When I'm trying to create a SP (Having union of 3 nested select
> statements) by executing the following code (The entire code is given
> below), it gives me an error -
>
> "Token unknown - SUSPEND"
>
> iF SUSPEND is removed, it gives error "Token unknown - END"
> i.e anything written after last SELECT is an error. May be last
> SELECT is having some problem. Or is there any other problem related
> to UNION?
>
>
> CREATE PROCEDURE showlocation(taxno INTEGER)
> AS
> BEGIN
> SELECT tblcountry.country || '/' || tblstate.state || '/' ||
> tblcounty.county AS location ,tblcounty.countyid AS locid ,'1' AS
> name
> FROM tblcounty,tblstate,tblcountry WHERE tblcountry.countryid =
> tblstate.countryid AND
> tblcounty.stateid = tblstate.stateid AND countyid IN
> (SELECT tblcounty.countyid FROM tblcounty,tbltaxcounty WHERE
> tblcounty.countyid = tbltaxcounty.countyid AND
> tbltaxcounty.taxid=:taxno)