🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.vdbase.data.sql
Article #956

Re: sql quirks

#956
From: Jason Ortner
Date: Fri, 05 Jun 1998 00:00
55 lines
2346 bytes


>The choice of which records to include in or exclude from the result
set is
>determined by conditions in the WHERE clause. The fields in the
SELECT
>clause of the statement should never affect this, regardless of their
order
>of appearance or whether they appear at all in the SELECT clause.
>
>Post your actual SQL statement.
>
>/////////////////////////////////////////////////////////////////////
/////
>Steve Koterski                      "Knowledge comes, but wisdom
lingers."
>Technical Publications                -- Alfred, Lord Tennyson
(1809-1914)
>INPRISE Corporation
>http://www.inprise.com/delphi
Steve,

Below is one form of the query.  If you change the order in which you
call the fields, the query results seem to change.  I am not a expert
in this and am just trying to understand why and how it works so I can
use it more effectively.
This particular query in on a form open event so I can datalink it to
a grid to be able to view the results.  BTW do you know of a more
efficient way to view the results?  I have tried many different forms
of this query and get results that are not what I expect in many
instances.

For instance if it reads:
where (headfn = '&hdfn')
and (headln = '&hdln')
and etc.

The query comes up blank.  Why?


Jason Ortner         jortnerxxppmm@onramp113.org
----------------------------------------------------------------------
-----------------------------------


form.fe = new query()
   form.fe.sql = "select
headfn,headln,heelfn,heelln,dateofrope,drawnum;
   from rope1.dbf rope1;
where (headfn = '&hdfn');
     AND (headln = '&hdln');
     OR (heelfn = '&hefn');
     and (heelln = '&heln');
     OR (headln = '&heln')"
Technical Details
Message-ID: <6lam93$is1@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6l9obd$t6j4@forums.borland.com> <3582875d.32043883@forums.inprise.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,7e01f50b41e45756
X-Google-Attributes: gidff5a1,public
From: "Jason Ortner" <jortner@onramp113.org>
Subject: Re: sql quirks
Date: 1998/06/05
Message-ID: <6lam93$is1@forums.borland.com>
X-Deja-AN: 360060301
Content-Transfer-Encoding: 7bit
References: <6l9obd$t6j4@forums.borland.com> <3582875d.32043883@forums.inprise.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.vdbase.data.sql