If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > Derived Table Produces ODBC Syntax Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-15-10, 15:19
ozzii ozzii is offline
Registered User
 
Join Date: Mar 2007
Posts: 194
Derived Table Produces ODBC Syntax Error

Hi,

I am trying to query a sybase databse via a ODBC ASE connection within SSRS.

However I get the following error when I attempt a query that uses a derived table:
Code:
SELECT application_name
FROM ( SELECT CASE WHEN name IN ('appliction_1', 'application_2') THEN 'My Application'
                   WHEN name IN ('appliction_3', 'application_4') THEN 'Your Application'
                   ELSE 'Other Application' END AS application_name
       FROM tbl_applications
       ORDER BY name ) x
WHERE application_name != 'Other Application'

ERROR [42000] [MERANT][ODBC Sybase ASE driver][SQL Server]Incorrect syntax near 'FROM'.

Any ideas? I've tried SELECT x.application_name but I still get the same error.
Reply With Quote
  #2 (permalink)  
Old 01-10-11, 08:51
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
Remove the order by clause
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On