Anyone help me with this one? I'm trying to get a very restricted set of
object data based on object attributes stored in the Spectra properties
table.
SQL Query:
<cfquery name="GetChildElements" datasource="#Request.cfa.objectstore.dsn#"
dbtype="ODBC">
SELECT sm.chardata AS SiteModel,
sm.objectid AS ObjectID,
ix.integerdata AS L3Index
FROM properties AS sm, properties AS ix
WHERE sm.objectid=ix.objectid
AND sm.propertyname='sitemodel'
AND sm.chardata LIKE '#SearchTitle#%'
AND ix.integerdata=1
ORDER BY sm.chardata ASC
</cfquery>
All this works, except that I am getting back too much data which I then
have to filter with CF code (unfortunately, too slow) by looping over the
query and excluding items with inappropriate data.
What I want to add to the query is a restriction that the return for
"sm.chardata AS SiteModel" can be a comma-separated list (as it already is),
but of no more then two items' length, e.g. I would accept "Quarantine,About
AQIS" but not "Food,Meat,Pork". The SiteModel attribute is ALWAYS a comma
separated list of 1-4 items' length. Currently, the query gets me back a
squillion hits which then have to be filtered down. The whole process takes
about 30 seconds (which is about 27 seconds too long).
Does SQL support this? Is there a better way?
Steve
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.