Subject RES: [firebird-support] SELECT INTO :var gives Unkown Token INTO error
Author Gerson Machado - Yahoo
Peter,

If you are using a stored procedure... see this example:
CREATE PROCEDURE DEPT_BUDGET (
DNO CHAR (3))
RETURNS (
TOT DECIMAL (12, 2))
AS
DECLARE VARIABLE sumb DECIMAL(12, 2);
DECLARE VARIABLE rdno CHAR(3);
DECLARE VARIABLE cnt INTEGER;
BEGIN
tot = 0;

SELECT budget FROM department WHERE dept_no = :dno INTO :tot;

SELECT count(budget) FROM department WHERE head_dept = :dno INTO :cnt;

IF (cnt = 0) THEN
SUSPEND;

FOR SELECT dept_no
FROM department
WHERE head_dept = :dno
INTO :rdno
DO
BEGIN
EXECUTE PROCEDURE dept_budget :rdno RETURNING_VALUES :sumb;
tot = tot + sumb;
END

SUSPEND;
END

Gerson



-----Mensagem original-----
De: Peter Welch [mailto:welchp@...]
Enviada em: sexta-feira, 17 de dezembro de 2004 13:59
Para: firebird-support@yahoogroups.com
Assunto: [firebird-support] SELECT INTO :var gives Unkown Token INTO
error




Here is the SQL that fails in IB_SQL's DSQL applied to a Firebird 1.5
table - dialect 3, I believe:

SELECT min(id) from trays where tray_no = :aTray INTO :Id;

Doesn't matter where I place the INTO.

'id' is the primary key but substituting a different field yields the
same results.

Very puzzled since this is an equivalent (syntax-wise) SQL statement
from an Interbase book.

Thank you for any interest in this matter.

Pete








Yahoo! Groups Sponsor

ADVERTISEMENT
HYPERLINK
"http://us.ard.yahoo.com/SIG=1299m32p8/M=294855.5468653.6549235.3001176/
D=groups/S=1705115386:HM/EXP=1103386667/A=2455396/R=0/SIG=119u9qmi7/*htt
p://smallbusiness.yahoo.com/domains/" \nclick here
HYPERLINK
"http://us.adserver.yahoo.com/l?M=294855.5468653.6549235.3001176/D=group
s/S=:HM/A=2455396/rand=847710632"


_____

Yahoo! Groups Links


* To visit your group on the web, go to:
HYPERLINK
"http://groups.yahoo.com/group/firebird-support/"http://groups.yahoo.com
/group/firebird-support/


* To unsubscribe from this group, send an email to:
HYPERLINK
"mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe
"firebird-support-unsubscribe@yahoogroups.com


* Your use of Yahoo! Groups is subject to the HYPERLINK
"http://docs.yahoo.com/info/terms/"Yahoo! Terms of Service.



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.5.4 - Release Date: 15/12/2004



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.5.4 - Release Date: 15/12/2004



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