Re:update query with "From" clause
The join is there, using the aliases. This is the query using table names.
UPDATE sales
SET cashCreditRate = payrates.rate
FROM sales, payrates
WHERE sales.cash_or_credit = payrates.id
It runs correctly using MS SQL7 with names or aliases both directly and
using ODBC through Dephi.
It does not work through the BDE with Delphi, Paradox or DBD.
It also does not work using MS Access, access tables.
I can get the same results using QBE.
Query
payrates.db | Id | Rate |
| _join1 | _theRate |
sales.DB | Cash_or_Credit | Cashcreditrate |
| _join1 | change to _theRate |
EndQuery
But the QBE cannot be converted to SQL statements by either the DBD or
Paradox 9.
I learned the format from the MS SQL7 help files some time ago. I'm leaning
more and more to it being an extension to SQL in MS SQL7.
Thanks
Bill
Quote
"Sundial Services" <info_...@sundialservices.com> wrote in message
news:3CC83A5A.49EA@sundialservices.com...
Quote
> You neglect to say how the tables are joined. Which record in
> "payrates" is Paradox supposed to use?
> Bill Hannan wrote:
> > Hi,
> > (Delphi 5 Pro)
> > I'm trying to get an update query to run against a paradox table that
> > includes a from clause. The query.
> > update sales
> > set cashCreditRate = d1.rate
> > FROM sales d, payrates d1
> > where d.cash_or_credit = d1.id
> > (tried both with aliases d & d1 and table names)
> > The query fails with a complaint about the "from".
> > The DBD help states:
> > "There are no restrictions on or extensions to the ANSI-standard UPDATE
> > statement."
> ----------------------------------------------------------------
> Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
> mailto:i...@sundialservices.com (PGP public key available.)
> > Fast(!), automatic table-repair with two clicks of the mouse!
> > ChimneySweep(R): Release 4.0 is here!!
> > http://www.sundialservices.com/products/chimneysweep