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
deesh
Participant
Posts: 193 Joined: Mon Oct 08, 2007 2:57 am
Post
by deesh » Wed Oct 21, 2009 9:12 am
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Wed Oct 21, 2009 9:55 am
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 » Wed Oct 21, 2009 9:55 pm
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 » Wed Oct 21, 2009 10:32 pm
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 » Thu Oct 22, 2009 4:00 am
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Oct 22, 2009 6:52 am
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 » Fri Oct 23, 2009 2:33 am
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? ...