Hi,
I made a user defined function that takes a varchar as a parameter.
fn_split('1,4,6')
where '1,4,6' is the varchar
It returns a table with the items splitted.
It works great, but when I try to use it in a select passing a field name it gives an error:
I have something like this
select st.*
from Store_Dept sd,
Store_Items si,
Store_Transactions st
where sd.Department_ID in (select Value from fn_split_list(si.Additional_Departments))
si.Additional_Departments contains a varchar as '1,2,3,4'
it gives me the error: Incorrect syntax near '.'
It drives me crazy. If I transmit a hardcoded list or a variable it works. If anything else, even the hardcoded list used in another function like CAST or Convert it gives me the error.
Did someone meet this
Thanks
Janoh
I made a user defined function that takes a varchar as a parameter.
fn_split('1,4,6')
where '1,4,6' is the varchar
It returns a table with the items splitted.
It works great, but when I try to use it in a select passing a field name it gives an error:
I have something like this
select st.*
from Store_Dept sd,
Store_Items si,
Store_Transactions st
where sd.Department_ID in (select Value from fn_split_list(si.Additional_Departments))
si.Additional_Departments contains a varchar as '1,2,3,4'
it gives me the error: Incorrect syntax near '.'
It drives me crazy. If I transmit a hardcoded list or a variable it works. If anything else, even the hardcoded list used in another function like CAST or Convert it gives me the error.
Did someone meet this
Thanks
Janoh