SQL server error on parameter

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
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

SQL server error on parameter

Post by srinivas.nettalam »

I am writing a simple join query in ODBC connector stage as below:

SELECT
a.IP_ID,
ltrim(rtrim(a.UNQ_ID_IN_SRC_STM)) as UNQ_ID_IN_SRC_STM_ID
FROM vwIP_S a,
vwSRC_STM_S b
WHERE a.SRC_STM_ID = b.SRC_STM_ID And
b.SRC_STM_CODE ='#p_SourceSystemCode#'

#p_SourceSystemCode# is a job parameter and it has value 'VS'

When I validate I am getting a warning like below:

ODBC_Ip: ODBC Info: SQLSTATE = 57: Native Error Code = 207: Msg = [IBM(DataDirect OEM)][ODBC 20101 driver][Microsoft SQL Server]Invalid column name 'VS'.
The same approach is working in another job without any warning.please help
N.Srinivas
India.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't see anything obviously wrong. What happens when you run the job?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

My guess (from the error message) is that the quotes are being stripped.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Does the parameter literally contain 'VS' (including the single quotes)?
josh.guffey
Participant
Posts: 40
Joined: Thu Apr 17, 2008 1:52 pm
Location: Huntsville, AL

Post by josh.guffey »

Take a look at this article. We just had the same issue using Oracle and used this information to solve the problem.
Post Reply