🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Help with a join.,..

#276
From: Bill Todd [TeamB]
Date: Fri, 15 Feb 2008 15:28
22 lines
1571 bytes
> 
> Can you be a little more verbose?

Creat a stored procedure with an output parameter for each field you
want in the result set.

Use a FOR SELECT with a UNION clause to get the unique IDs from both
tables.

FOR SELECT ID FROM TABLE1 UNION SELECT ID FROM TABLE2
INTO :ID
DO...

In the DO block you can select the records for each ID from each table,
decide which values you want in the output and assign those values to
the output parameters.

If you are not familiar with it, read the chapter on stored procedures
in the Data Definition Guide. It should answer most of your questions.

-- 
Bill Todd (TeamB)
Technical Details
Message-ID: <47b5bdc9@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <47b4b0fa$1@newsgroups.borland.com> <47b4c5a7$1@newsgroups.borland.com> <47b5a8a4@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,81f9d25eabdd893f
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bill Todd [TeamB]" <no@no.com>
Subject: Re: Help with a join.,..
Newsgroups: borland.public.interbase.sql
References: <47b4b0fa$1@newsgroups.borland.com> <47b4c5a7$1@newsgroups.borland.com> <47b5a8a4@newsgroups.borland.com>
Organization: The Database Group, Inc.
User-Agent: XanaNews/1.18.1.9
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
NNTP-Posting-Host: 65.118.176.23
Message-ID: <47b5bdc9@newsgroups.borland.com>
Date: 15 Feb 2008 08:28:57 -0700
X-Trace: newsgroups.borland.com 1203092937 65.118.176.23 (15 Feb 2008 08:28:57 -0700)
Lines: 22
X-Authenticated-User: btodd
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail