Board index » delphi » Operation not supported error for Join with LIKE clause
Mark Wallin
![]() Delphi Developer |
Mon, 31 May 2004 01:49:22 GMT
|
Mark Wallin
![]() Delphi Developer |
Mon, 31 May 2004 01:49:22 GMT
Operation not supported error for Join with LIKE clause
I am getting an 'operation not supported' error when I run a SQL statement
containing two joined tables and a LIKE clause. I have no problems doing a similar query where a single table is involved. The sql statement is as follows: SELECT a.*,b.claim_no,b.claim_sufx, b.carrier_no,b.date_loss,b.class_loss, Anybody know why this fails? Thanks for any input, |
Team
![]() Delphi Developer |
Mon, 31 May 2004 01:58:35 GMT
Re:Operation not supported error for Join with LIKE clauseTry changin clmnt_last LIKE to a.clmnt_last LIKE -- |
Mark Walli
![]() Delphi Developer |
Mon, 31 May 2004 05:32:24 GMT
Re:Operation not supported error for Join with LIKE clauseActually, that is what it was in my code - I just didn't copy it correctly to the message. I still get the same error. I believe, however, that what I want to do will work if I use a subquery instead of a direct join. I just wonder why what I have doesn't work in local tables. If this kind of thing is not supported by the BDE, it does not seem to be documented. I tried the same query in SQL Server with two tables and it works OK without using a subquery. "Bill Todd (TeamB)" <bill.nos...@dbginc.com> wrote in message Quote> Try changin clmnt_last LIKE to a.clmnt_last LIKE |
Team
![]() Delphi Developer |
Mon, 31 May 2004 08:14:24 GMT
Re:Operation not supported error for Join with LIKE clauseEvery database implements its own dialect of SQL and Local SQL, the dialect used for Paradox and dBase tables is quite limited in some ways. -- |
Wayne Niddery [TeamB
![]() Delphi Developer |
Mon, 31 May 2004 08:13:28 GMT
Re:Operation not supported error for Join with LIKE clauseQuote"Mark Wallin" <mwal...@cauinsure.com> wrote in message Quote> I am getting an 'operation not supported' error when I run a SQL statement Is RequestLive set true? If so then try turning it off. Local SQL does -- |
Mark J. Walli
![]() Delphi Developer |
Mon, 31 May 2004 14:58:43 GMT
Re:Operation not supported error for Join with LIKE clauseI am using a .DBF table (dbase driver). The result set doesn't have to be live in this case and I am using an ORDER by as the last sql statement. I will check to see how requestlive is set. As mentioned, the Join works fine and the query works fine if I substitute an '=' for the 'LIKE'. I have just verified that the same code using the JOIN and the LIKE works fine using SQL SERVER tables. It just gives me the error using the DBF tables when LIKE is used. I also found that I could use a subquery to join the tables and LIKE works OK in that scenario but I really need to use the JOIN because I need some fields in the second table, whereas with the subquery method, I can't get any of the other fields out of the second table (only one field can be used in the subquery SELECT). Quote"Wayne Niddery [TeamB]" wrote: |
Mark Walli
![]() Delphi Developer |
Mon, 31 May 2004 23:04:13 GMT
Re:Operation not supported error for Join with LIKE clauseQuote> You don't say what database. driver) via the BDE ver. 5.11. The requestLive property was set to false and I tried it both ways but it doesn't change the outcome. I am using an ORDER BY so the result set would not be live anyway. As I said, if I change the LIKE to '=' and eliminate the '%', the query works as advertised. With LIKE and '%', it fails with the 'operation not applicable'. Here is the exact syntax of the offending code I am using: qClaimant.sql.add('SELECT a.*, b.claim_no, b.claim_sufx, '+ I am not using parameters as the same query table is used for other queries. SELECT * FROM claimant a Unfortunately, I need a JOIN to get what I need. |
Wayne Niddery [TeamB
![]() Delphi Developer |
Tue, 01 Jun 2004 08:11:19 GMT
Re:Operation not supported error for Join with LIKE clauseQuote"Mark Wallin" <mwal...@cauinsure.com> wrote in message Quote
This is a requirement in Local SQL - all order by fields must be selected. If the sort fields are indeed present in the select clause then I can't tell qClaimant.sql.add('FROM claimant a, claims b') ; -- |
Mark Walli
![]() Delphi Developer |
Tue, 01 Jun 2004 23:02:58 GMT
Re:Operation not supported error for Join with LIKE clauseOops, there were mistakes in my proposed test code. The corrected test syntax is *** Equi-join code that fails with an 'operation not supported' error: *** Syntax that works via sub-query |
Mark Walli
![]() Delphi Developer |
Tue, 01 Jun 2004 22:52:20 GMT
Re:Operation not supported error for Join with LIKE clause"Wayne Niddery [TeamB]" <wnidd...@aci.on.ca> wrote in message Quote> If the sort fields are indeed present in the select clause then I can't BDE/local SQL doesn't like "LIKE" in joined tables, no way, no how. I would appreciate it if someone could verify this by doing a simple join by either the JOIN clause or the equi-join, just as a sanity check. It is always possible that there is something peculiar about my dbf tables and indexes, but as everything works with an '=' and not with a 'LIKE' indicates to me that it is something systemic, and thus should be documented for dbf tables if not fixed. The sql that would cause the program to crash would be something like this: SELECT p.* FROM parentTable p or in the equi-join case which also crashes: SELECT p.*, c.* The syntax that does work with local dbf tables (no crash, good result) for However, in the last case, you don't get access to the fields of the child Thanks, |
Wayne Niddery [TeamB
![]() Delphi Developer |
Wed, 02 Jun 2004 06:16:53 GMT
Re:Operation not supported error for Join with LIKE clauseQuote"Mark Wallin" <mwal...@cauinsure.com> wrote in message Quote
following on the sample dbase files in dbdemos: select * from clients c Symbol is an indexed field so I also tried this with an unindexed field, Sorry I can't offer any more, all I can tell you is it *should* work. Try -- |
Mark Walli
![]() Delphi Developer |
Sun, 06 Jun 2004 03:56:44 GMT
Re:Operation not supported error for Join with LIKE clauseQuote> There is something unique about your sytem/data/something. I tried the or some other set of tables. Its always possible that there is something peculiar about the tables but I don't know what it is. Reindexing didn't help. It could also be some 'junk' in some of the records, which has caused occasional crashes and might be showing up here. The tables use .MDX indexes, so I don't know if that is a factor. There are quite a few indexes involved, some more or less redundant (not very well designed), and I had to add another one recently. I guess I have to take your word that 'it should work'. However, it doesn't in my case and I did a rather elaborate work around to get the necessary effect which will have to do until we switch to a SQL Server database. I will be glad to do so for another reason - I spend a great deal of time dealing with Crystal Reports which likes to stop working if you do anything stupid like try to change table structures or pack your tables or pretty much anything else including the what the outside temperature is that day. I'm told that it works better with SQL tables: how could it be worse? Thanks for your input, |
Mark Walli
![]() Delphi Developer |
Sat, 14 Aug 2004 08:56:42 GMT
Re:Operation not supported error for Join with LIKE clauseQuote> Try changin clmnt_last LIKE to a.clmnt_last LIKE Thanks, |
Mark Walli
![]() Delphi Developer |
Sat, 14 Aug 2004 08:56:43 GMT
Re:Operation not supported error for Join with LIKE clauseQuote> Is the field(s) specified in sSortOrd also included in the Select clause? sSortOrd. I will give your equi-join suggestion a try and see if that works. It looks like it should work. Thanks, |
1. SQL error: Table does not support this operation because it is not uniquely indexed
2. ERROR: Operation not supported...
3. Error: Blob and array types are not supported for compare operations
4. DBX Error: Operation Not Supported.
5. dbExpress Error: Operation Not Supported.
6. Error : Table does not support this operation
7. Error:Table Does not Support this operation
8. MSSQL:Table does not support this operation because it is not uniquely indexed
9. where and join clause in same sql statement not working
10. Table does not support this operation because it is not uniquely indexed