🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Store procedure Help

#715
From: Roy
Date: Wed, 01 Aug 2007 23:48
61 lines
1980 bytes
Hello,

I need to pass to a stored procedure a list of values similar to a list used 
in SQL using the ' IN' statement. I have written a procedure that works with 
=  but I do not know how to make it work with the IN stateement. I want to 
replace GROUP_ =  with GROUP_ IN. The input field is MSCALL.

Grateful for your assistance.

The stored procedure is as follows.

SET TERM ^ ;

/* Stored procedures */

CREATE PROCEDURE "DOSYSTRAFFIC"
(
  "MSCALL" CHAR(40),
  "DATE1" DATE,
  "DATE2" DATE,
  "TIME1" TIME,
  "TIME2" TIME
)
RETURNS
(
  "START_DATETIME" TIMESTAMP,
  "SYSTEM_TRAFFIC" DOUBLE PRECISION
)
AS
BEGIN EXIT; END ^


ALTER PROCEDURE "DOSYSTRAFFIC"
(
  "MSCALL" CHAR(40),
  "DATE1" DATE,
  "DATE2" DATE,
  "TIME1" TIME,
  "TIME2" TIME
)
RETURNS
(
  "START_DATETIME" TIMESTAMP,
  "SYSTEM_TRAFFIC" DOUBLE PRECISION
)
AS
 begin
 For
 Select START_DATETIME, SUM(TRAFFIC) from SysGrpPerf where
 START_DATE BETWEEN :"DATE1" and :"DATE2" AND GROUP_ = :"MSCALL" AND
 START_TIME BETWEEN :"TIME1" AND :"TIME2"
 GROUP BY START_DATETIME
 INTO :"START_DATETIME",:"SYSTEM_TRAFFIC"
 Do
  suspend;
end
 ^

SET TERM ; ^
COMMIT WORK;
SET AUTODDL ON; 
Technical Details
Message-ID: <46b11bc5@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,3cbc3361bcc5aca9,start
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Roy" <butcherr@candw.lc>
Newsgroups: borland.public.interbase.sql
Subject: Store procedure Help
Date: Wed, 1 Aug 2007 18:48:16 -0500
Lines: 63
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 200.2.131.50
Message-ID: <46b11bc5@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1186012101 200.2.131.50 (1 Aug 2007 16:48:21 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail