🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

SQL Question

#317
From: Craig Veal
Date: Fri, 01 Jan 1999 00:00
45 lines
2448 bytes
I've tried to follow the CLASS DATAMODULE EXAMPLE from OLH, but still
can't make this beast do what I want it to!

I have a table of clients (companies) that each have a unique id (COMPID
- numeric).  I have a 2nd table (XREF) of cross references that contains
only COMPID (numeric) and AGENTID (numeric).  The 3rd table contains
agents with a unique id (AGENTID - numeric).

The form has 2 grids on it (one with clients and the other with
agents).  Each client can have multiple agents and each agent can have
represent multiple clients.  The XREF table contains ONLY those agents
who have 1 or more clients.

I have successfully set up the 3 rowsets and the XREF rowset properly
responds when the clients rowset pointer is moved and restricts itself
to just the agent numbers (AGENTID) that correspond to the company id#
(COMPID). The agents rowset does NOT show the correct agents.  

The sql reference is an external sql file produced by the sql designer. 
When it is run by itself, the resulting rowset is correct, but when
placed on the form, the agents rowset is wrong.

The sql designer produced the following (contained in XREF.SQL)
SELECT Agents.AGENTID, Agents.NAME, Agents.CITY, Agents.STATE
FROM "agents.dbf" Agents
   INNER JOIN "xref.dbf" Xref
   ON  (Agents.AGENTID = Xref.AGENTID)  , "clients.dbf" Clients
WHERE   (Agents.AGENTID = Xref.AGENTID)
   AND  (Xref.COMPID = Clients.COMPID)
ORDER BY Agents.NAME


I tried to force a reevaluation of the rowset by reassigning the sql
pointer to itself (form.agents1.sql = form.agents1.sql).  This appears
to be forcing the rowset to reevaluate the sql link (lots of hard drive
activity), but the resulting records do not match what the should be
(wrong agent names). How do I reset the sql link to make it reevaluate
the agents?

Thanks in advance!

Craig
Gator Custom Software
------------------------------------------------------------
"If A Computer Crashes In Cyberspace, Does It Make A Sound?"
Technical Details
Message-ID: <368D3114.82F8A14A@cfi.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,2e1c13aae25a9cd4,start
X-Google-Attributes: gidff5a1,public
From: Craig Veal <cdveal@cfi.net>
Subject: SQL Question
Date: 1999/01/01
Message-ID: <368D3114.82F8A14A@cfi.net>
X-Deja-AN: 427803273
Content-Transfer-Encoding: 7bit
Organization: Gator Custom Software
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.vdbase.data.sql