ODBC_Connector: column name with question mark in the name

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
coder
Participant
Posts: 1
Joined: Thu Dec 01, 2016 1:41 pm

ODBC_Connector: column name with question mark in the name

Post by coder »

In ODBC_Connector under "SQL" --> "Select statement" I have a SQL statement that references a column name that contains a question mark in the name.
Example:
select
[NM Study?] as nm_study
from dbo.view_study

Looks like DataStage is replacing the "?" with the word "null" and so returns an error saying 'Invalid column name "NM Studynull"'.
(Note: I am connecting to MS SQL Server via the ODBC_Connector)

Below is the exact error message when I try to "View data":
ODBC function "SQLNumResultCols" reported" SQLSTATE = 42522: Native Error Code = 207:Msg=[IBM(DataDirect OEM)][ODBCSQL Server Wire Protocol driver][Microsoft SQL Server] Invalid column name "NM Studynull"
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Question marks aren't legal as far as DataStage is concerned. I think in SQL Server you'll need to have the DBA create an a view where the column is renamed with "AS newcolumnname". Then you'll use the view to access the table.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
Post Reply