🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Query CDS

#695
From: Bill Todd
Date: Thu, 19 Jul 2007 00:33
47 lines
2468 bytes
Serra wrote:

> }'m very sorry for disturbing you Bill
> but i dont know the partnos(AAA,BBB,CCC)  how can i get them ?
> and how can i add to my select statement

Sorry but I do not understand your question. In your last message you
said that the PARTNO is in the OrderDetail records. Here is the
OrderDetail information from your last message.

CDS (OrderDetail Table) :

PartNo  PartName  Qty   UPrice
--------------------------------------------
AAA        AAAAA      1       100
BBB        BBBBB     10      200
CCC       CCCCC    20      300

Are you saying that you do not know how to write the code to get the
PARTNO values from the OrderDetail CDS?

var
  S: String;
begin
  OrderDetailCds.First;
  while not OrderDetailCds.EOF do
  begin
    if S = '' then
      S := S + ' PARTNO = ' + 
        QuotedStr(OrderDetailCds.FieldByName('PARTNO').AsString)
    else
      S := S + ' OR PARTNO = ' + 
        QuotedStr(OrderDetailCds.FieldByName('PARTNO').AsString)
    OrderDetailCds.Next;
  end;

At the end of this code the variable S contains 

PARTNO = 'AAA' OR PARTNO = 'BBB' OR PARTNO =
'CCC'

Concatenate it to the end of the string SELECT * FROM PARTS WHERE and
you have the SQL statement to assigne to the CommandText  property of
the Parts CDS.

-- 
Bill Todd (TeamB)
Technical Details
Message-ID: <469eb14b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.euro.net!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <469bdbf9$1@newsgroups.borland.com> <469bf567$1@newsgroups.borland.com> <469e7611@newsgroups.borland.com> <469e893d$1@newsgroups.borland.com> <469e9074@newsgroups.borland.com> <469e9583@newsgroups.borland.com> <469e9aa6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,76c2c8ad3cbcc7f0
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bill Todd" <no@no.com>
Subject: Re: Query CDS
Newsgroups: borland.public.interbase.sql
References: <469bdbf9$1@newsgroups.borland.com> <469bf567$1@newsgroups.borland.com> <469e7611@newsgroups.borland.com> <469e893d$1@newsgroups.borland.com> <469e9074@newsgroups.borland.com> <469e9583@newsgroups.borland.com> <469e9aa6$1@newsgroups.borland.com>
Organization: The Database Group, Inc.
User-Agent: XanaNews/1.18.1.6
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: 216.207.211.19
Message-ID: <469eb14b$1@newsgroups.borland.com>
Date: 18 Jul 2007 17:33:15 -0700
X-Trace: newsgroups.borland.com 1184805195 216.207.211.19 (18 Jul 2007 17:33:15 -0700)
Lines: 47
X-Authenticated-User: btodd
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.euro.net!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail