Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 5th, 2011, 07:59 AM
Christian98 Christian98 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2011
Posts: 1 Christian98 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 2 sec
Reputation Power: 0
Token unknown - [ODBC firebird driver][firebird]dynamic sql error

Hello Community,

we have an ERP software that is based on a Firebird 2.1 Server. With the help on the ODBC driver, I read data from the DB into Excel and create several reports with PivotTables.

On my computer (Win7 64bit, MS Office 2010 32bit) everything works fine in Excel and FlameRobin, that I use to create my code. However, on other PCs of my co-workers and customers, I once in a whole get the following error:

[ODBC firebird driver][firebird]dynamic sql error
SQL error code=-104
Line ...
Token unknown
WHEN ... could also be FROM

Everyone is using the latest ODBC driver 2.0.0.151 and has the DB connected properly.
I thought, there might be an issue with Office 2010 64bit. However, that can't be, as I have other co-workers with 32bit Office that can open and refresh my Excel files created on Office 2010 64bit.
As for the error at the word "WHEN" I thought, the ODBC driver can't handle the CASE WHEN construct in my queries. I replaced it with an IIF, leading to the error at the word "FROM".

Here's my code.

SELECT
EXTRACT(YEAR FROM an.ORDERDAT) Yr,
CASE EXTRACT(MONTH FROM an.ORDERDAT)
WHEN '1' THEN '01 - January'
WHEN '2' THEN '02 - February'
WHEN '3' THEN '03 - March'
WHEN '4' THEN '04 - April'
WHEN '5' THEN '05 - May'
WHEN '6' THEN '06 - June'
WHEN '7' THEN '07 - July'
WHEN '8' THEN '08 - August'
WHEN '9' THEN '09 - September'
WHEN '10' THEN '10 - October'
WHEN '11' THEN '11 - November'
WHEN '12' THEN '12 - Dezember'
END Mon,
COUNT(ord.ORDERNR) ORDER_AMOUNT,
SUM(a.ORDERSUM) ORDER_SUM, p.MATCHCODE SalesRep, p.MATCHCODE || " (" || ord.EMPNO || ")" SalesRep_EMPNO, ord.EMPNO,
CASE
WHEN ord.DEPTNR < 10 THEN '0' || ord.DEPTNR
ELSE ord.DEPTNR
END DEPT
FROM TABLE1 a
INNER JOIN TABLE5 ord ON a.ORDERIDNR=ord.ORDERIDNR
INNER JOIN TABLE2 an ON a.ORDERIDNR=an.ORDERIDNR
INNER JOIN TABLE3 p ON ord.EMPNO=p.TABLE3NR
INNER JOIN TABLE4 g ON ord.DEPTNR=g.DEPTNR
WHERE an.ORDERDAT>='01.01.2011'
GROUP BY
EXTRACT(YEAR FROM an.ORDERDAT),
CASE EXTRACT(MONTH FROM an.ORDERDAT)
WHEN '1' THEN '01 - January'
WHEN '2' THEN '02 - February'
WHEN '3' THEN '03 - March'
WHEN '4' THEN '04 - April'
WHEN '5' THEN '05 - May'
WHEN '6' THEN '06 - June'
WHEN '7' THEN '07 - July'
WHEN '8' THEN '08 - August'
WHEN '9' THEN '09 - September'
WHEN '10' THEN '10 - October'
WHEN '11' THEN '11 - November'
WHEN '12' THEN '12 - Dezember'
END, p.MATCHCODE, p.MATCHCODE || " (" || ord.EMPNO || ")", ord.EMPNO,
CASE
WHEN ord.DEPTNR < 10 THEN '0' || ord.DEPTNR
ELSE ord.DEPTNR
END


Does anyone have any ideas what could cause the problem only on 1% of the machines rolled out and how it can be solved? Maybe I have to change my code.
Any help is highly appreciated!

Christian

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Token unknown - [ODBC firebird driver][firebird]dynamic sql error

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap