Using Delphi's Database Explorer on a Paradox table and cannot seem to get a nested query to reference the outer table e.g.
SELECT
PayFreq,
(select count(*) from LocalEmps2 AS E2
WHERE E2.PayFreq = E1.PayFreq) FCount
FROM LocalEmps1 E1
GROUP BY PayFreq
Returns FCount as zero...
Ah - Sussed it!
The SQL field was a tinyint not an integer value.
Therefore casting it as a smallint i.e.
CAST(13 AS SmallInt) did the job.
Thanks to everyone for your help and inspiration.
Regards - Paul.
That's right.
The Paradox table contains the records of the employees who are to receive a letter. This contains the Employees Code, and other general details.
The SQL Table contains records for Employees who are to receive letters. This contains the Employees Code plus the details of the...
Perhaps I have been unclear. There is no user_ref field in the paradox table. I am trying to pass an integer constant in place of this missing field and this is where the problem lies i.e.
a) This works (passing field values from one table to another)
Insert into...
Inserting data into an SQL2000 table from Paradox, but get an "Invalid Parameter" error if I try to use a constant e.g.
Insert into ":SQLDatabase:SQLTable"
(Members_Code, User_Ref)
Select Members_Code, 13
From ParadoxTable
Works fine if I change 13 for an integer...
Have used heterogeneous queries successfully before but cannot understand why the following doesn't work.
INSERT INTO ":SQLSRVR:Table1" (Members_Code)
SELECT Members_Code FROM ":localStuff:Table2"
SQLSRVR is the SQL Server defined via the ODBC.
LocalStuff is the database...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.