Board index » delphi » DELPHI 2.0 SQL PROBLEM - Borland Bug?

DELPHI 2.0 SQL PROBLEM - Borland Bug?

I have a problem with the following SELECT statement under Delphi 2.0 (works
fine undel Delphi 1.02) using a paradox table with a Primary key of AcctServID
which is an autoincrement field.  Secondary Maintained Casesensitive Indexes on
ServiceID (A 8)  and two unrelated fields.

SELECT * FROM AcctServ
WHERE ServiceID = 'One'

This returns a ~300 records  (it also works for = 'Two' or 'Three')

SELECT * FROM AcctServ
WHERE ServiceID IN ('One','Two','Three')

This returns 0 records... WHY?

SELECT * FROM AcctServ
WHERE ServiceID = 'One' OR ServiceID = 'Two' OR ServiceID 'Three'

This also returns 0 records... WHY?

 

Re:DELPHI 2.0 SQL PROBLEM - Borland Bug?


In article <4kesj5$...@orb.direct.ca>, Colin Bieberstein
<cbieb...@direct.ca> writes
Quote
>I have a problem with the following SELECT statement under Delphi 2.0 (works
>fine undel Delphi 1.02) using a paradox table with a Primary key of AcctServID
>which is an autoincrement field.  Secondary Maintained Casesensitive Indexes on
>ServiceID (A 8)  and two unrelated fields.

>SELECT * FROM AcctServ
>WHERE ServiceID = 'One'

>This returns a ~300 records  (it also works for = 'Two' or 'Three')

>SELECT * FROM AcctServ
>WHERE ServiceID IN ('One','Two','Three')

>This returns 0 records... WHY?

>SELECT * FROM AcctServ
>WHERE ServiceID = 'One' OR ServiceID = 'Two' OR ServiceID 'Three'

>This also returns 0 records... WHY?

Delphi 1 did not seem to care whether you used single quotes or double
quotes around strings. The manuals told you to use double quotes.

Have you tried using double quotes in Delphi 2? Maybe the parser is more
demanding?
--
Barney Tyrwhitt-Drake

Re:DELPHI 2.0 SQL PROBLEM - Borland Bug?


On 9 Apr 1996 23:41:25 GMT, cbieb...@direct.ca (Colin Bieberstein) wrote:

Quote
>SELECT * FROM AcctServ
>WHERE ServiceID = 'One' OR ServiceID = 'Two' OR ServiceID 'Three'
>This also returns 0 records... WHY?

I ran into this shit, too.  Solution:

SELECT * FROM AcctServ A
WHERE (A."ServiceID" = 'One') OR (A."ServiceID" = 'Two') OR (A."ServiceID" = 'Three')

----------------------------------------------
AutoWinNet 2.0!  Automate your Internet - FAST

http://www.computek.net/autownet

---------------------------------------------------

Re:DELPHI 2.0 SQL PROBLEM - Borland Bug?


In article <4c99FGAKowaxE...@tdrake.demon.co.uk>, bar...@tdrake.demon.co.uk
says...

Quote

>In article <4kesj5$...@orb.direct.ca>, Colin Bieberstein
><cbieb...@direct.ca> writes
>>I have a problem with the following SELECT statement under Delphi 2.0 (works
>>fine undel Delphi 1.02) using a paradox table with a Primary key of
AcctServID
>>which is an autoincrement field.  Secondary Maintained Casesensitive Indexes
on
>>ServiceID (A 8)  and two unrelated fields.

>>SELECT * FROM AcctServ
>>WHERE ServiceID = 'One'

>>This returns a ~300 records  (it also works for = 'Two' or 'Three')

>>SELECT * FROM AcctServ
>>WHERE ServiceID IN ('One','Two','Three')

>>This returns 0 records... WHY?

>>SELECT * FROM AcctServ
>>WHERE ServiceID = 'One' OR ServiceID = 'Two' OR ServiceID 'Three'

>>This also returns 0 records... WHY?

>Delphi 1 did not seem to care whether you used single quotes or double
>quotes around strings. The manuals told you to use double quotes.

>Have you tried using double quotes in Delphi 2? Maybe the parser is more
>demanding?
>--
>Barney Tyrwhitt-Drake

I tried using single and double quotes with no different results.  I also fed
it through the new Database Desktop 7.0 to make sure that it wasn't a component
problem.  It seems like a bde problem.  Can you try a table to verify this?  I
am stumped!

Colin Bieberstein
cbieb...@direct.ca

Re:DELPHI 2.0 SQL PROBLEM - Borland Bug?


In article <316bf9fc.83192...@news.airmail.net>, phys...@computek.net says...

Quote

>On 9 Apr 1996 23:41:25 GMT, cbieb...@direct.ca (Colin Bieberstein) wrote:

>>SELECT * FROM AcctServ
>>WHERE ServiceID = 'One' OR ServiceID = 'Two' OR ServiceID 'Three'

>>This also returns 0 records... WHY?

>I ran into this shit, too.  Solution:

>SELECT * FROM AcctServ A
>WHERE (A."ServiceID" = 'One') OR (A."ServiceID" = 'Two') OR (A."ServiceID" =
'Three')

Thanks!  I never thought of an alias...  What is Borland Coming to?  
Other that this HUGE SQL problem Delphi 2.0 has been very nice though.

Colin

Re:DELPHI 2.0 SQL PROBLEM - Borland Bug?


Quote
>>I ran into this shit, too.  Solution:

>>SELECT * FROM AcctServ A
>>WHERE (A."ServiceID" = 'One') OR (A."ServiceID" = 'Two') OR (A."ServiceID" =
>'Three')

>Thanks!  I never thought of an alias...  What is Borland Coming to?  
>Other that this HUGE SQL problem Delphi 2.0 has been very nice though.

        WHY does the alias fix it? (I too have had similar problems). I assume this we
cn classify as a bug, but how about a response from Borland.

_
******************************************************************
NOTE: This software is currently in early alpha. If you notice any
problems, or RFC non-compliance, please report it to p...@pobox.com
Please do not report duplicates, as this is usually a manual resend
+------------------------------------------------------------+
|Chad Z. Hower  -  phoe...@pobox.com                         |
|Phoenix Business Enterprises - p...@pobox.com - www.pbe.com  |
|Physically in Church Hill, TN - Logically Not Sure          |
+------------------------------------------------------------+

Quote
>>SQUID - The ultimate 32 bit offline databasing reader

**Special Compile: 3.000A (Alpha)

Other Threads