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

Query of Query

Explorer ,
Mar 06, 2009 Mar 06, 2009
HI, I have a query :
<cfquery name="LocationDataDisplay" datasource="IMV1">
SELECT ID, Cat_ID, Categorie, CategorieB, CategorieC, FR_Info, FR_Tag, EN_Info, EN_Tag, List, Active
FROM LocationData
<cfif IsDefined ("URL.C") is true>
WHERE Active = 'true' and Cat_ID = '#URL.Loc#' and Categorie = '#URL.C#' and List LIKE '%#URL.SC#%'
</cfif>
ORDER BY FR_Tag ASC
</cfquery>

That I want to change for a query of query but my List LIKE '%#URL.SC#%' is not working, I tried contains but not working... ?

<cfquery dbtype="query" name="LocationDataDisplay">
SELECT ID, Cat_ID, Categorie, CategorieB, CategorieC, FR_Info, FR_Tag, EN_Info, EN_Tag, List, Active
FROM LocationData
<cfif IsDefined ("URL.C") is true>
WHERE Active = 'true' and Cat_ID = '#URL.Loc#' and Categorie = '#URL.C#' and List LIKE '%#URL.SC#%'
</cfif>
ORDER BY FR_Tag ASC
</cfquery>


How should I write it?
TOPICS
Getting started
882
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 ,
Mar 06, 2009 Mar 06, 2009
what do you mean by 'not working'?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
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
Explorer ,
Mar 06, 2009 Mar 06, 2009
It create an error!

here it is:
Error Occurred While Processing Request
The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.
Null Pointers are another name for undefined values.

It look like the List LIKE '%#URL.SC#%' generate an error of some kind!
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 ,
Mar 06, 2009 Mar 06, 2009
That's not it. Do you have a query named LocationData?
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
Explorer ,
Mar 06, 2009 Mar 06, 2009
Well, if it is not it, I have no ideas on what can create the error because if I turne the entier query to a simple query request with that code everything is fine and I get result back

If I turn the query into a query of query the same

LIKE '%xxx%' generate the error, If I remove that part only, query of query is fine!

So in other words, the "LIKE" is my problem
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 ,
Mar 06, 2009 Mar 06, 2009
What is the select clause for the query, locationdata?
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 ,
Mar 06, 2009 Mar 06, 2009
> <cfquery name="LocationDataDisplay" datasource="IMV1">
> SELECT ID, Cat_ID, Categorie, CategorieB, CategorieC, FR_Info, FR_Tag,
> EN_Info, EN_Tag, List, Active
> FROM LocationData

> <cfquery dbtype="query" name="LocationDataDisplay">
> SELECT ID, Cat_ID, Categorie, CategorieB, CategorieC, FR_Info, FR_Tag,
> EN_Info, EN_Tag, List, Active
> FROM LocationData

Don't you mean "LocationDataDisplay" rather than "LocationData" in that
second query?

--
Adam
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
New Here ,
Mar 10, 2009 Mar 10, 2009
LATEST
may be it is due to url parameters having null values...
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