Saturday, February 25, 2012

Problem with using UNION in the where clause.

Hi, I'm using the JDBC:ODBC bridge but am having a problem using it with MS
Access.
I want to run the following thru the bridge;
SELECT * FROM Horse WHERE horseName Like 'MINORS UNION'
I can run this query in Access with no probs. I get an SQL.Exception when
running thru the bridge. I am running thru a try catch block.
I am assuming the problem lies with the keyword UNION being used in the
value.
any help appreciated,
Michael.
I haven't done very much with the JDBC/ODBC bridge. I would think that as
long as the expression 'MINOR UNION' is a valid string delimited by quotes,
the reserved word theory should not be a factor. Can you post the exact
SQLException that you receive?
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
| From: "Finbar Saunders" <finbar@.netspace.net.au>
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| Subject: Problem with using UNION in the where clause.
| Date: Fri, 16 Apr 2004 17:46:42 +0930
| Organization: Netspace Internet
| Lines: 16
| Message-ID: <c5o4p6$2i17$1@.otis.netspace.net.au>
| NNTP-Posting-Host: dsl-203-113-238-176.sa.netspace.net.au
| X-Trace: otis.netspace.net.au 1082103398 84007 203.113.238.176 (16 Apr
2004 08:16:38 GMT)
| X-Complaints-To: usenet@.otis.netspace.net.au
| NNTP-Posting-Date: Fri, 16 Apr 2004 08:16:38 +0000 (UTC)
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!newsfeed.wirehub.nl!surfnet.nl!newsfeed.kabel foon.nl!195.129.110.21.MIS
MATCH!bnewsfeed00.bru.ops.eu.uu.net!bnewsinpeer01. bru.ops.eu.uu.net!emea.uu.
net!ash.uu.net!duster.adelaide.on.net!news.melbour ne.pipenetworks.com!news.l
abyrinth.net.au!news.netspace.net.au!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.jdbcdriver:5892
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hi, I'm using the JDBC:ODBC bridge but am having a problem using it with
MS
| Access.
|
| I want to run the following thru the bridge;
| SELECT * FROM Horse WHERE horseName Like 'MINORS UNION'
|
| I can run this query in Access with no probs. I get an SQL.Exception when
| running thru the bridge. I am running thru a try catch block.
|
| I am assuming the problem lies with the keyword UNION being used in the
| value.
|
| any help appreciated,
| Michael.
|
|
|

No comments:

Post a Comment