[dba-SQLServer] SQL error in Excel query to IBM DB2 data source
Zimmer, Michael
Michael.Zimmer at federalmogul.com
Fri Apr 29 11:47:21 CDT 2016
Hi Gustav,
I've tried to remove the quotes with no results. I don't know if putting in the quotes is hard coded into the query wizard or not, but removing them returns the exact same error.
I cannot find a place in the ODBC administration to specifiy the SET QUOTED_IDENTIFIER which is an answer I say on the web somewhere.
IBM has a page about this problem with no resolution unfortunately. http://www-01.ibm.com/support/docview.wss?uid=nas8N1017228
The other thing I tried is to change the encoding of the CCSID string from ASCII to Unicode, then Unicode2. Again with no results.
This is a head scratcher.
-----Original Message-----
From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Friday, April 29, 2016 11:40 AM
To: Discussion concerning MS SQL Server
Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source
Hi Mike
I guess the alias should be non-quoted:
KMRL01.MRLDT AS ArrivalDate
/guess
-----Oprindelig meddelelse-----
Fra: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] På vegne af Zimmer, Michael
Sendt: 29. april 2016 18:33
Til: dba-sqlserver at databaseadvisors.com
Emne: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source
Hi all,
We have an odd situation: A query using data from an ODBC connection runs fine on our Win 7 PCs with Excel '07. However, the query can only be edited on one machine, on all others editing the query returns this error:
"SQL0104 - Token 'ArrivalDate' was not valid. Valid tokens: <IDENTIFIER>."
In the query we have a data field called "MRLDT" and we renamed it to "ArrivalDate" so that it is meaningful to the end users.
Here is the SQL statement for the query:
SELECT KMRL01.MPROD, KMRL01.MRLDT AS 'ArrivalDate', KMRL01.MRDTE AS 'ShipDate', right(MPRNT,6) AS 'Location', KMRL01.MQTY FROM MAN400.BPCSF9.KMRL01 KMRL01 WHERE (KMRL01.MPROD='750197') AND (KMRL01.MRDTE<=20160615)
No matter what I've tried, I cannot find a way to amend the SQL statement so that I can edit the arrival date ranges.
However, the spreadsheet as a whole runs fine on all of our PCs. Just no editing of queries where we rename the column headings to a meaningful title.
Thanks
Mike
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com
More information about the dba-SQLServer
mailing list