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

isQuery Query Object name

Guest
May 28, 2009 May 28, 2009

Hi All,

I am identifying whether a particular structure is a query object or not using isQuery(<some variable name>). If its a query object i need to find out the query object name . I tried getMetaData function but it didnt help . Can anyone help me how to identify the name of the query object.

1.2K
Translate
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 ,
May 28, 2009 May 28, 2009

Isn't it the value of your variable?

Translate
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
Guest
May 28, 2009 May 28, 2009

No not the value of the variable.

For ex:

<CFQUERY NAME="check">

....

I need to find the query object name. Like when i check for ifQuery(<object name>) , it should return the query object name. According to the example it should return "check"

Translate
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 ,
May 28, 2009 May 28, 2009

Sounds like someone needs to read the cfml reference manual.  I'll go first

http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000529.htm

It is misleading isn't it.  It doesn't say that the function will either return true or false, but that's what actually happens.

Translate
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
Community Expert ,
May 29, 2009 May 29, 2009
I am identifying whether a particular structure is a query object or not using isQuery(some_variable_name). If its a query object i need to find out the query object name.

As Dan suggested, some_variable_name.

Translate
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
Guest
May 29, 2009 May 29, 2009

Sorry i framed the question wrongly.

We are storing all complex objects in a structure and sending it to some other function.

Once the function recieves the structure as paramater , it loops through the structure and it will isolate the query objects(using the isquery function)

But for some debugging info i need to identify the query object names that was isolated during the isquery function.

Translate
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
Valorous Hero ,
May 29, 2009 May 29, 2009

And I think you are not understanding what everybody is telling you.

Whatever you pass to the isQuery() function parameter IS the name of the query record set object!  There is no hidden name.  If at one time the query record set was stored under a different variable name before it was passed into the complex structure you are examining has no relevance and stands a good chance of not even existing anymore.

Translate
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 ,
May 29, 2009 May 29, 2009
LATEST

Regarding "

Whatever you pass to the isQuery() function parameter IS the name of the query record set object!  There is no hidden name.  If at one time the query record set was stored under a different variable name before it was passed into the complex structure you are examining has no relevance and stands a good chance of not even existing anymore."

Try this.

theStruct = Strucnew();

<cfquery name="TheStruct.query1">

<cfloop collection="#thestruct#" item="abc">

<cfif isquery(abc)>

output whatever variable gives you "query1"

Translate
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 ,
May 29, 2009 May 29, 2009

Now I'm starting to see the problem.  You might have to do something like this:

<cfquery name = "abc">

select blah, blaugh, "abc" queryname

from etc

in all your queries.

Translate
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
Guest
May 29, 2009 May 29, 2009

Thank you all for answering this.

I was looking for something like getMetaData function which gives me some idea about the object.

Thank you Dan for giving me a workaround.

Translate
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