ODBC Enterprise Stage ,Can not pass job parameters
Moderators: chulett, rschirm, roy
-
piyush1234
- Participant
- Posts: 4
- Joined: Fri Sep 19, 2008 3:18 am
ODBC Enterprise Stage ,Can not pass job parameters
hi I am trying to pass Job parameter to Query in Odbc Enterprise stage
e.g .
SELECT
Count(ID) As NUMBER_OF_REC
FROM
SDM_PLAN
WHERE
#jpTmpTestFilter# DAY >= to_date('31/12/2005','DD/MM/YYYY')
And jpTmpTestFilter = CUSTOMER_NUMBER IN ('01135101','01200662') AND
it select 0 rows ,But view data show all records
e.g .
SELECT
Count(ID) As NUMBER_OF_REC
FROM
SDM_PLAN
WHERE
#jpTmpTestFilter# DAY >= to_date('31/12/2005','DD/MM/YYYY')
And jpTmpTestFilter = CUSTOMER_NUMBER IN ('01135101','01200662') AND
it select 0 rows ,But view data show all records
: piyush
-
piyush1234
- Participant
- Posts: 4
- Joined: Fri Sep 19, 2008 3:18 am
ODBC Enterprise stage ,job parameter in SQL
ArndW wrote:Ok, I missed that. I thought the OP had used both in the SELECT statement and that the values (and syntax) didn't match.
My firs thought is that the embedded single quotes in the parameter are not making it to the query correctly. Can you see the parameter value, with single quotes, in the Job Log?
thanks,
you r correct,
when i remove single quote its works that i found out before ,but my requirement is to to pass it as varchar,when i pass charetor without quote
it gives error
main_program: [DataDirect][ODBC Oracle Wire Protocol driver][Oracle]ORA-00904: "ABCD": invalid identifier
e.g. job parameter
CUSTOMER_NUMBER IN (01135101,01200662,ABCD) AND
: piyush
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
piyush1234
- Participant
- Posts: 4
- Joined: Fri Sep 19, 2008 3:18 am
reply
ray.wurlod wrote:If it's VarChar ALL of the values in the IN list must be quoted in single quotes. ...
that i know ,and that single quote is creating problem
e.g. if we pass job parameter valuen as
CUSTOMER_NUMBER IN ('01135101','01200662','ABCD') AND
view data will show records , and when we run job 0 rows get selected
But
if we pass parameter as CUSTOMER_NUMBER IN (01135101,01200662)
i.e. with out single quote
it will give correct output
: piyush
-
piyush1234
- Participant
- Posts: 4
- Joined: Fri Sep 19, 2008 3:18 am
ArndW wrote:In this case it works because the number string is implicitly converted to number format. Will the quoting work if you use "\'" instead of "'"? ...
That i have tried
but it gives error as Invalid charecter ,even view data is not possible
but i like to confirm ,do u like to say like this
e.g. job parameter
CUSTOMER_NUMBER IN (\'01135101\',\'01200662\',\'ABCD\') AND
: piyush
It's been reported as working in some areas, guess not here. Something else to try is two single quotes for each one:
CUSTOMER_NUMBER IN (''01135101'',''01200662'',''ABCD'') AND
Note they are NOT double-quotes, but rather two single quotes. I guess you could also try a quoted quote and see if that makes it down the ODBC rabbit hole:
CUSTOMER_NUMBER IN ('''01135101''','''01200662''','''ABCD''') AND
Three single quotes for each one.
CUSTOMER_NUMBER IN (''01135101'',''01200662'',''ABCD'') AND
Note they are NOT double-quotes, but rather two single quotes. I guess you could also try a quoted quote and see if that makes it down the ODBC rabbit hole:
CUSTOMER_NUMBER IN ('''01135101''','''01200662''','''ABCD''') AND
Three single quotes for each one.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
</a>