• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Does anyone know why....

Explorer ,
Jul 05, 2007 Jul 05, 2007

Copy link to clipboard

Copied

You can't put write query cells (<cfset temp = QuerySetCell) inside of <cfif> tags? Whenever I try it the code won't run. It just skips that portion completely.

Thanks in advance,

Anthony
TOPICS
Advanced techniques

Views

466

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 05, 2007 Jul 05, 2007

Copy link to clipboard

Copied

Anthony Spears wrote:
> You can't put write query cells (<cfset temp = QuerySetCell) inside of <cfif> tags? Whenever I try it the code won't run. It just skips that portion completely.
>
> Thanks in advance,
>
> Anthony

Can you show some code? I can not say I have ever tried this exact
concept. But I can't see why it would be a problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 05, 2007 Jul 05, 2007

Copy link to clipboard

Copied

never had a problem with having querysetcell inside a cfif/cfelse block.

make sure:
a) your cfif condition validates to true so the code inside (the
querysetcell code) is executed
b) you are not forgetting the queryaddrow() part before querysetcell()


---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 05, 2007 Jul 05, 2007

Copy link to clipboard

Copied

quote:

Originally posted by: Anthony Spears
You can't put write query cells (<cfset temp = QuerySetCell) inside of <cfif> tags? Whenever I try it the code won't run. It just skips that portion completely.

Thanks in advance,

Anthony

When stuff like that happens to me, it is pretty much always because the condition of the cfif tag is not met.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 06, 2007 Jul 06, 2007

Copy link to clipboard

Copied

The coditions of the cfif are being met. Other code within the tag is being executed. I actually populated an array inside in of same cfif tag.

Yes, I did the queryaddrow. The code works just fine outside of the cfif tag.

There is no fancy code. Just querysetcells inside of a cfif tag. The query is created outside of the cfif tag. This is not the first time I have encountered it. I wasn't looking for a solution. More of looking to see if anyone else has experienced this. Perhaps this is a bug/limitation in cold fusion.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2007 Jul 06, 2007

Copy link to clipboard

Copied

LATEST
quote:

Originally posted by: Anthony Spears
The coditions of the cfif are being met. Other code within the tag is being executed. I actually populated an array inside in of same cfif tag.

Yes, I did the queryaddrow. The code works just fine outside of the cfif tag.

There is no fancy code. Just querysetcells inside of a cfif tag. The query is created outside of the cfif tag. This is not the first time I have encountered it. I wasn't looking for a solution. More of looking to see if anyone else has experienced this. Perhaps this is a bug/limitation in cold fusion.

When I run this code (sisi is an oracle db),
<cfquery name="x" datasource="sisi">
select 'a' as aaa from dual
</cfquery>
<cfdump var="#x#">
<cfif true>
<cfset temp = QuerySetCell(x, "aaa", "b")>
</cfif>
<cfdump var="#x#">

I see a on the first dump and b on the second. What happens when you try it, or something similar if you don't use oracle?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation