Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 2 of 2 total |
Using Derived tables - Example 2 |
Wed, Jan 7 2009 5:27 PM | Permanent Link |
Richard Harding | Tim,
Another derived table example. The SQL is: SELECT * FROM UserDefinedFields LEFT OUTER JOIN (SELECT * FROM JobFields WHERE JobID = 8004) T1 ON T1.UserFieldID = UserDefinedFields.ID WHERE UserDefinedFields.ClientType = 2 ORDER BY Sequence In the program: qyJobFields.SQL.Clear; qyJobFields.SQL.Add('SELECT * FROM UserDefinedFields AS UDF '); qyJobFields.SQL.Add('LEFT OUTER JOIN (SELECT * FROM JobFields WHERE JobID = '); qyJobFields.SQL.Add(dmData.qyJobsForContact.FieldByName('ID').AsString); qyJobFields.SQL.Add(') T1 ON T1.UserFieldID = UserDefinedFields.ID '); qyJobFields.SQL.Add('WHERE UserDefinedFields.ClientType = 2 '); qyJobFields.SQL.Add('ORDER BY Sequence'); qyJobFields.Open; If I then do a Locate on other table (taX.Locate('ID', SomeValue, []), then an AV occurs. If I replace the derived table with the table JobFields the AV does not occur. Does this make any sense? Richard Harding. |
Thu, Jan 8 2009 7:52 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Richard,
<< If I then do a Locate on other table (taX.Locate('ID', SomeValue, []), then an AV occurs. If I replace the derived table with the table JobFields the AV does not occur. Does this make any sense? >> Not really. Could you possibly send me an example of this, including the data ? -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |