Use SQLSearches. Mark the property that you wish to search on as
Searchable. This will create an entry in a table in your CODB called
properties, on which you can run SQL statements.
For example if I have a property called Quantity on an object and wanted to
find all objects with a Quantity bigger than 50, I would first mark the
property as 'Searchable' when creating the type. Now when I create my
objects, Spectra will automatically populate the Properties table in my CODB
with the Quantity property of my objects.
To display all objects with a quantity bigger than 50, I can use the
following code:
<!--- Find all the objects --->
<CFQUERY Datasource="MyApplication" Name="BigObjects">
SELECT ObjectID
FROM Properties
WHERE PropertyName='Quantity' AND numericdata > 50
</CFQUERY>
<!--- Display them --->
<cfa_contentObject Datasource="#Request.datasource.dsn#"
lObjectIDs="#ValueList(BigObjects.ObjectID)#"
method="Display">
BTW. If it would be much quicker to code your original statements as:
<cfa_contentObjectGetMultiple Datasource="XXX" TypeID="XXXXX"
r_stObjects="#stObjects#" bActiveOnly="NO">
<CFLOOP Collection="#stObjects#" Item="ObjectID">
<CFSET stparentloc = stObjects[ObjectID]>
<!--- Do if statement, (you don't need the hashes, (or pound signs if
your American!)) --->
<cfif variable1 eq stparentloc.name>
.............
.............
</cfif>
</CFLOOP>
Any mistakes don't blame me, I'm doing this off the top of my head :-)
-David 'Maddog' Maddison
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.