structFindValue
Ok... so structFindValue returns and array with a structure in it. How do I output a value in that structure? I CFDump it and it has this in it, hopefully you understand what I mean. Array 1 Struct 1 Key - Type Owner Struct Cost - 50 Type - foo Path - .moo[1].type I want to output the value of cost that is in the structure that is in the array. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329933 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
re: structFindValue
I think you just want #myVar[1].Owner.Cost# ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329937 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: structFindValue
Thanks Jason! That worked. I would putting the [] in the wrong place. -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Thursday, January 21, 2010 12:52 PM To: cf-talk Subject: re: structFindValue I think you just want #myVar[1].Owner.Cost# ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329954 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: structFindValue
How do I output a value in that structure? The same as usual, just a little more convoluted ;) #theArray[indexOfTheElementYouWant].owner.cost# ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329963 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: StructFindValue Question...
How about cfif arrayMax(query[OptNurseryOnly]) You have ones /cfif On 10/9/06, Che Vilnonis [EMAIL PROTECTED] wrote: Hmmm. I'm just trying to use what code has the least amount of overhead. Perhaps I would be better just using the ValueList function instead of Q of Q? Thanks, Che -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:20 PM To: CF-Talk Subject: RE: StructFindValue Question... I agree with Dan... No matter how complex the query is, query of queries should be able to handle it. I doubt any sort of StructFind type thing would be more powerful than a query of queries. Maybe if you gave us more info, we could help you construct your query of queries. ... Ben Nadel Certified Advanced ColdFusion Developer www.bennadel.com -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:14 PM To: CF-Talk Subject: RE: StructFindValue Question... Dan, unfortunately, I gave a stripped down example. The main query is more complex (has 10 or so columns w/multiple WHERE clauses) and would not work well with a Q of Q as dynamic values are passed to it. Any other ideas? -Original Message- From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:11 PM To: CF-Talk Subject: RE: StructFindValue Question... Che, You can use Queries-of-Queries: cfquery name=getCount dbtype=query select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 /cfquery That would give you the count of the number of entries that had OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, you'll want to use apostrophes around the value.) -Dan -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:05 PM To: CF-Talk Subject: StructFindValue Question... I *think* I need to use StructFindValue here. Not sure. I have a simple query. One of the columns is named OptNurseryOnly. The values returned from the db can only be a one or a zero. I'd like to use some type of conditional logic to know if any 1s are returned in the query *w/o looping through the query or using a valuelist funtion* but I cannot quite get it to work. Something like: cfif StructFindValue(query.OptNurseryOnly, 1, ALL) do something /cfif What am I doing wrong? ~Che ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256093 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: StructFindValue Question...
Che, Dan, unfortunately, I gave a stripped down example. The main query is more complex (has 10 or so columns w/multiple WHERE clauses) and would not work well with a Q of Q as dynamic values are passed to it. Any other ideas? The complexity of the original query doesn't really matter. The QoQ functionality allows you to take a query object and then break that query down farther by using T-SQL based statements. If your original query was named queryName, the original code I posted (which is below) would do exactly what you wanted to do w/the StructFind() function. cfquery name=getCount dbtype=query select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 /cfquery -Dan ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256101 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
StructFindValue Question...
I *think* I need to use StructFindValue here. Not sure. I have a simple query. One of the columns is named OptNurseryOnly. The values returned from the db can only be a one or a zero. I'd like to use some type of conditional logic to know if any 1s are returned in the query *w/o looping through the query or using a valuelist funtion* but I cannot quite get it to work. Something like: cfif StructFindValue(query.OptNurseryOnly, 1, ALL) do something /cfif What am I doing wrong? ~Che ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256026 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: StructFindValue Question...
Che, You can use Queries-of-Queries: cfquery name=getCount dbtype=query select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 /cfquery That would give you the count of the number of entries that had OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, you'll want to use apostrophes around the value.) -Dan -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:05 PM To: CF-Talk Subject: StructFindValue Question... I *think* I need to use StructFindValue here. Not sure. I have a simple query. One of the columns is named OptNurseryOnly. The values returned from the db can only be a one or a zero. I'd like to use some type of conditional logic to know if any 1s are returned in the query *w/o looping through the query or using a valuelist funtion* but I cannot quite get it to work. Something like: cfif StructFindValue(query.OptNurseryOnly, 1, ALL) do something /cfif What am I doing wrong? ~Che ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256027 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: StructFindValue Question...
Dan, unfortunately, I gave a stripped down example. The main query is more complex (has 10 or so columns w/multiple WHERE clauses) and would not work well with a Q of Q as dynamic values are passed to it. Any other ideas? -Original Message- From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:11 PM To: CF-Talk Subject: RE: StructFindValue Question... Che, You can use Queries-of-Queries: cfquery name=getCount dbtype=query select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 /cfquery That would give you the count of the number of entries that had OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, you'll want to use apostrophes around the value.) -Dan -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:05 PM To: CF-Talk Subject: StructFindValue Question... I *think* I need to use StructFindValue here. Not sure. I have a simple query. One of the columns is named OptNurseryOnly. The values returned from the db can only be a one or a zero. I'd like to use some type of conditional logic to know if any 1s are returned in the query *w/o looping through the query or using a valuelist funtion* but I cannot quite get it to work. Something like: cfif StructFindValue(query.OptNurseryOnly, 1, ALL) do something /cfif What am I doing wrong? ~Che ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256028 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: StructFindValue Question...
I agree with Dan... No matter how complex the query is, query of queries should be able to handle it. I doubt any sort of StructFind type thing would be more powerful than a query of queries. Maybe if you gave us more info, we could help you construct your query of queries. .. Ben Nadel Certified Advanced ColdFusion Developer www.bennadel.com -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:14 PM To: CF-Talk Subject: RE: StructFindValue Question... Dan, unfortunately, I gave a stripped down example. The main query is more complex (has 10 or so columns w/multiple WHERE clauses) and would not work well with a Q of Q as dynamic values are passed to it. Any other ideas? -Original Message- From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:11 PM To: CF-Talk Subject: RE: StructFindValue Question... Che, You can use Queries-of-Queries: cfquery name=getCount dbtype=query select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 /cfquery That would give you the count of the number of entries that had OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, you'll want to use apostrophes around the value.) -Dan -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:05 PM To: CF-Talk Subject: StructFindValue Question... I *think* I need to use StructFindValue here. Not sure. I have a simple query. One of the columns is named OptNurseryOnly. The values returned from the db can only be a one or a zero. I'd like to use some type of conditional logic to know if any 1s are returned in the query *w/o looping through the query or using a valuelist funtion* but I cannot quite get it to work. Something like: cfif StructFindValue(query.OptNurseryOnly, 1, ALL) do something /cfif What am I doing wrong? ~Che ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256029 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: StructFindValue Question...
Hmmm. I'm just trying to use what code has the least amount of overhead. Perhaps I would be better just using the ValueList function instead of Q of Q? Thanks, Che -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:20 PM To: CF-Talk Subject: RE: StructFindValue Question... I agree with Dan... No matter how complex the query is, query of queries should be able to handle it. I doubt any sort of StructFind type thing would be more powerful than a query of queries. Maybe if you gave us more info, we could help you construct your query of queries. ... Ben Nadel Certified Advanced ColdFusion Developer www.bennadel.com -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:14 PM To: CF-Talk Subject: RE: StructFindValue Question... Dan, unfortunately, I gave a stripped down example. The main query is more complex (has 10 or so columns w/multiple WHERE clauses) and would not work well with a Q of Q as dynamic values are passed to it. Any other ideas? -Original Message- From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:11 PM To: CF-Talk Subject: RE: StructFindValue Question... Che, You can use Queries-of-Queries: cfquery name=getCount dbtype=query select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 /cfquery That would give you the count of the number of entries that had OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, you'll want to use apostrophes around the value.) -Dan -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:05 PM To: CF-Talk Subject: StructFindValue Question... I *think* I need to use StructFindValue here. Not sure. I have a simple query. One of the columns is named OptNurseryOnly. The values returned from the db can only be a one or a zero. I'd like to use some type of conditional logic to know if any 1s are returned in the query *w/o looping through the query or using a valuelist funtion* but I cannot quite get it to work. Something like: cfif StructFindValue(query.OptNurseryOnly, 1, ALL) do something /cfif What am I doing wrong? ~Che ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256030 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: StructFindValue Question...
How many records are typically returned by the query? On 10/9/06, Che Vilnonis [EMAIL PROTECTED] wrote: Hmmm. I'm just trying to use what code has the least amount of overhead. Perhaps I would be better just using the ValueList function instead of Q of Q? Thanks, Che -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:20 PM To: CF-Talk Subject: RE: StructFindValue Question... I agree with Dan... No matter how complex the query is, query of queries should be able to handle it. I doubt any sort of StructFind type thing would be more powerful than a query of queries. Maybe if you gave us more info, we could help you construct your query of queries. ... Ben Nadel Certified Advanced ColdFusion Developer www.bennadel.com -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:14 PM To: CF-Talk Subject: RE: StructFindValue Question... Dan, unfortunately, I gave a stripped down example. The main query is more complex (has 10 or so columns w/multiple WHERE clauses) and would not work well with a Q of Q as dynamic values are passed to it. Any other ideas? -Original Message- From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:11 PM To: CF-Talk Subject: RE: StructFindValue Question... Che, You can use Queries-of-Queries: cfquery name=getCount dbtype=query select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 /cfquery That would give you the count of the number of entries that had OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, you'll want to use apostrophes around the value.) -Dan -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:05 PM To: CF-Talk Subject: StructFindValue Question... I *think* I need to use StructFindValue here. Not sure. I have a simple query. One of the columns is named OptNurseryOnly. The values returned from the db can only be a one or a zero. I'd like to use some type of conditional logic to know if any 1s are returned in the query *w/o looping through the query or using a valuelist funtion* but I cannot quite get it to work. Something like: cfif StructFindValue(query.OptNurseryOnly, 1, ALL) do something /cfif What am I doing wrong? ~Che ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256032 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Problem with StructFindValue
Hi, I'm on CF5.0 With StructFindValue(structName,searchterm,ONE), everything is fine if the search term is one word. But when it is two (or more) words, I get this error: StructFindValue(): Illegal value string specifed. Value string: AAA BBB I tried replacing spaces with nbsp; and %20 but, not surprisingly, the entry was then not found. Anyone know the fix for this? I know I could loop over for instance, a StructKeyList but would prefer a single-statement solution, TIA Dave ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:246424 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Problem with StructFindValue
Post the actual code... -Original Message- From: Dave Francis [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 11:15 AM To: CF-Talk Subject: Problem with StructFindValue Hi, I'm on CF5.0 With StructFindValue(structName,searchterm,ONE), everything is fine if the search term is one word. But when it is two (or more) words, I get this error: StructFindValue(): Illegal value string specifed. Value string: AAA BBB I tried replacing spaces with nbsp; and %20 but, not surprisingly, the entry was then not found. Anyone know the fix for this? I know I could loop over for instance, a StructKeyList but would prefer a single-statement solution, TIA Dave ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:246435 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Problem with StructFindValue
I believe this may have been a bug in CF5. You may need to switch to a manual search, or see if there are hot fixes for CF5. On 7/13/06, Dave Francis [EMAIL PROTECTED] wrote: Hi, I'm on CF5.0 With StructFindValue(structName,searchterm,ONE), everything is fine if the search term is one word. But when it is two (or more) words, I get this error: StructFindValue(): Illegal value string specifed. Value string: AAA BBB I tried replacing spaces with nbsp; and %20 but, not surprisingly, the entry was then not found. Anyone know the fix for this? I know I could loop over for instance, a StructKeyList but would prefer a single-statement solution, TIA Dave ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:246436 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
structFindValue document bug or CFMX bug?
From reading the CFMX documentation (CFMX CFML reference book) I'm under the impression that the structFindValue function takes either a structure or an array from which to start the search. Pg. 631 - Parameter: Top, Description: ColdFusion object (a structure or an array) from which to start search. But trying to search an array produces the following error: You have attempted to dereference a scalar variable of type class coldfusion.runtime.Array as a structure with members. So who's bad is it?? chris kief ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com