Page 1 of 1

SQL server error on parameter

Posted: Wed Mar 07, 2012 6:24 am
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

Posted: Wed Mar 07, 2012 7:57 am
by chulett
I don't see anything obviously wrong. What happens when you run the job?

Posted: Wed Mar 07, 2012 3:04 pm
by ray.wurlod
My guess (from the error message) is that the quotes are being stripped.

Posted: Wed Mar 07, 2012 3:28 pm
by Kryt0n
Does the parameter literally contain 'VS' (including the single quotes)?

Posted: Fri Mar 09, 2012 9:54 am
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.