aborting job while executing the select statement

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

aborting job while executing the select statement

Post by deesh »

SELECT
`A`.`A Key` AS A_Key,
`A`.`E Key` AS E_Key,
`A`.ID
FROM
dbo.`A`
I am trying above query in ODBC connector but its giving bellow error, please can clarify any one


[IIS-CONN-ODBC-000004] ODBC function {0} reported: SQLSTATE = 42000: Native Error Code = 102: Msg = [IBM (DataDirect OEM)][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '`'.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First try using single quotes (') rather than that accent mark (`).
-craig

"You can never have too many knives" -- Logan Nine Fingers
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

Post by deesh »

I tried with single quote its giving below error.

[IIS-CONN-ODBC-000004] ODBC function {0} reported: SQLSTATE = 42000: Native Error Code = 102: Msg = [IBM (DataDirect OEM)][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'Key'.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What happens when you let DataStage generate the SQL based on the table definition you have imported?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
HariK
Participant
Posts: 68
Joined: Thu May 17, 2007 1:50 am

Post by HariK »

I have never worked on SQL server. But the question is, is it possible to have spaces in column identifiers ('A Key') in SQL Server?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ODBC doesn't support them, from what I recall. For Access you'd need to put square brackets around them, perhaps the same would work here?
-craig

"You can never have too many knives" -- Logan Nine Fingers
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

Post by deesh »

thanx for your help and with the " [ ] " brackets my problem has solved
chulett wrote:ODBC doesn't support them, from what I recall. For Access you'd need to put square brackets around them, perhaps the same would work here? ...
Post Reply