Article View: borland.public.interbase.sql
Article #10971Multiple rows in singleton select error
From: Elad Keat
Date: Wed, 01 Jan 2003 20:22
Date: Wed, 01 Jan 2003 20:22
24 lines
1508 bytes
1508 bytes
I wrote this procedure to look for users within an certein age range,
however, when I run it I get the error message: "Multiple rows in singleto
select".
Why is my select considered a singleton, and what can I do to get multiple
rows back?
SET TERM !! ;
CREATE PROCEDURE SEARCH_USERS
(MIN_AGE SMALLINT, MAX_AGE SMALLINT)
RETURNS (ID INTEGER)
AS
BEGIN
SELECT USER_ID
FROM USERS
WHERE CAST (EXTRACT (YEAR FROM CAST ('NOW' AS DATE)) AS SMALLINT) -
CAST (EXTRACT (YEAR FROM DATE_OF_BIRTH) AS SMALLINT)
BETWEEN :MIN_AGE AND :MAX_AGE
INTO :ID;
END!!
SET TERM ; !!
Thanks,
Elad
Technical Details
Message-ID:
<3e134e06@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114a0e,4e898bb479eb6127,start X-Google-Attributes: gid114a0e,public X-Google-ArrivalTime: 2003-01-01 12:40:03 PST From: "Elad Keat" <elad@NOSPAM.COM> Newsgroups: borland.public.interbase.sql Subject: Multiple rows in singleton select error Date: Wed, 1 Jan 2003 22:22:35 +0200 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 212.179.179.179 Message-ID: <3e134e06@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1041452550 212.179.179.179 (1 Jan 2003 12:22:30 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail