Reading Column names with spaces in between

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
in_finity307
Participant
Posts: 20
Joined: Sat Aug 09, 2008 1:53 pm

Reading Column names with spaces in between

Post by in_finity307 »

Hi,

I am trying to read data from a table which has column names defined as [Original Cost] on a source system. I am using an ODBC Connector Stage to write a select query like 'Select A."Original Cost" as Original_Cost from A". But I am getting an error for incorrect syntax.

How can we write a SQL Select query in datastage to read this column?
in_finity307
Participant
Posts: 20
Joined: Sat Aug 09, 2008 1:53 pm

Post by in_finity307 »

the source database is Microsoft Access.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

-craig

"You can never have too many knives" -- Logan Nine Fingers
in_finity307
Participant
Posts: 20
Joined: Sat Aug 09, 2008 1:53 pm

Name containg #

Post by in_finity307 »

I have another problem now. The Column name is 'Customer #'.
I am reading it as

SELECT [Customer #] as Customer from XXX

in the ODBC Connector stage. But on running the job, the job aborts giving the error thet 'Execute failed don the Select statement'.

Any workaround for this>?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's one mentioned in the linked thread. You may also have a way to handle 'special characters' like # in column names, check the connector docs. DS_ENABLE_RESERVED_CHAR_CONVERT works for Oracle.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply