csteinhilber
Programmer
I have something of a problem.
I'm accessing a legacy Oracle table from ColdFusion, and trying to relate it to a brand new table. The legacy table ("supArticles"
contains articles in the following columns:
The products are one-to-many... ie - a single article can be associated with multiple products.
I'm trying to relate the products field with a new look-up table ("supProducts"
.
Unfortunately, the supArticles.products contains product numbers in a non-quoted set (35,467,735,1021...)
I'm trying to select from both tables with something akin to
but, of course, a.products not being quoted, the query gets evaluated as
instead of
and nothing gets returned (unless a.products is a single value equal to product_num).
Is there a way to "qualify" the set in a.products? Something like CF's ListQualify() function... but in SQL itself. Or is there any other way I might be able to do this?
I thought about using LIKE... but LIKE '%35%' would return 735, etc as well, which would be undesired.
Any help would be much appreciated.
Thanks,
-Carl
Hope it helps,
-Carl
I'm accessing a legacy Oracle table from ColdFusion, and trying to relate it to a brand new table. The legacy table ("supArticles"
Code:
id, name, author, date, products ...
The products are one-to-many... ie - a single article can be associated with multiple products.
I'm trying to relate the products field with a new look-up table ("supProducts"
Unfortunately, the supArticles.products contains product numbers in a non-quoted set (35,467,735,1021...)
I'm trying to select from both tables with something akin to
Code:
<CFQUERY name="articleproducts" datasource="DS01">
SELECT
a.name,a.author,p.product_name
FROM
supArticles a,supProducts p
WHERE
p.product_num IN (a.products)
:
</CFQUERY>
but, of course, a.products not being quoted, the query gets evaluated as
Code:
WHERE '35' IN ('35,467,735,1021')
Code:
WHERE '35' IN ('35','467','735','1021')
Is there a way to "qualify" the set in a.products? Something like CF's ListQualify() function... but in SQL itself. Or is there any other way I might be able to do this?
I thought about using LIKE... but LIKE '%35%' would return 735, etc as well, which would be undesired.
Any help would be much appreciated.
Thanks,
-Carl
Hope it helps,
-Carl