Article View: borland.public.interbase.sql
Article #10956Re: JOINING 3 TABLES
From: Sergio Gonzalez
Date: Tue, 31 Dec 2002 04:21
Date: Tue, 31 Dec 2002 04:21
43 lines
2466 bytes
2466 bytes
Thanks for replying Bill! I'll try to put it clear: the SELECT statement I've posted is supposed to be the SelectSQL of my Purchase_Orders_Items table. It is the detail table of other that has the fields NUMERO and ID_TIPO_DES. I insist in this matter, because I know that the master table will pass the parameter for NUMERO (that's the PK) but: it will pass the parameter for ID_TIPO_DES ?? if doesn't here I have my first problem. This field represent the "kind of description" of the items in all the lines of the purchase order (I.e.: all the descriptions may be in English or Spanish) The user types it when he creates a new purchase order. I need to show all the selected fields in a dbGrid. But I only see the fields that belongs to the main table (ORDEN_COMPRA_1) the others remain blank. Actually when I pull down the listbox in order to choose the field name in the FieldName property of the column property of the dbGrid I see only the fields of ORDEN_COMPRA_1. I'm not using the JOIN clause because I don't know how to use it with more than 2 tables. Here I post the select again: select oc.*, des.NOMBRE, ar.CODIGO, ar.CODIGO_BARON, ar.CODIGO_S_PROV from ORDEN_COMPRA_1 oc, DESCRIPCIONES des, ARTICULO ar where oc.NUMERO = :NUMERO and oc.ID_ARTICULO = des.ID and oc.ID_ARTICULO = ar.ID and des.ID_TIPO_DES = :ID_TIPO_DES Thanks again! Sergio
Technical Details
Message-ID:
<3e111bfd$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!telocity-west!DIRECTV!203.109.225.2!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3e10b17c@newsgroups.borland.com> <27f11v8svcl7nf4u3v6ja8fvrmshonp1tn@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114a0e,287ab2d1cf2e4217 X-Google-Attributes: gid114a0e,public X-Google-ArrivalTime: 2002-12-30 20:36:03 PST Reply-To: "Sergio Gonzalez" <shg@sion.com> From: "Sergio Gonzalez" <shg@sion.com> Newsgroups: borland.public.interbase.sql References: <3e10b17c@newsgroups.borland.com> <27f11v8svcl7nf4u3v6ja8fvrmshonp1tn@4ax.com> Subject: Re: JOINING 3 TABLES Date: Tue, 31 Dec 2002 01:21:17 -0300 Lines: 46 Organization: SG X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 200.69.36.77 Message-ID: <3e111bfd$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1041308669 200.69.36.77 (30 Dec 2002 20:24:29 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!telocity-west!DIRECTV!203.109.225.2!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail