🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #11303

Re: SP... :(((

#11303
From: Martijn Tonies
Date: Wed, 27 Nov 2002 10:26
46 lines
2110 bytes
Hi,

> CREATE PROCEDURE GETVALUE (TblIndex Varchar(30),
>      FldIndex Integer)
> returns (FldValue Varchar(255))
> AS
>      declare variable counter Integer;
> begin
>   counter = 0;
>   for select VALORE FROM Tabella having( Select * FROM DOC_Tabella WHERE
> ID_TABELLA=:TblIndex)
>   into FldValue
>   counter = counter+1
>   if counter >= 1 then
>   exit;
>   Suspend;
> end
>
> It seems not being recognizing "Select *" in the "having" clause.

What's the error message you're getting?

From my personal syntax-check tool, you need a DO after a FOR SELECT clause.
Also, it's better to use : before the variables in the INTO clause. I also don't
see a
BEGIN END block after your FOR SELECT ... Why are you using FOR SELECT
anyway? Why not use a SELECT INTO statement?

Why are you using SUSPEND?

The source you've posted above is plain wrong at multiple places...


--

With regards,

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

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."
Technical Details
Message-ID: <3de49d38$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3de4999d@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114a0e,4ef17858837c20e7
X-Google-Attributes: gid114a0e,public
X-Google-ArrivalTime: 2002-11-27 02:38:06 PST
From: "Martijn Tonies" <m.tonies@upscene_remove.com>
Newsgroups: borland.public.interbase.sql
References: <3de4999d@newsgroups.borland.com>
Subject: Re: SP... :(((
Date: Wed, 27 Nov 2002 11:26:19 +0100
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 212.238.179.102
Message-ID: <3de49d38$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1038392632 212.238.179.102 (27 Nov 2002 02:23:52 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail