Link to home
Start Free TrialLog in
Avatar of Coast Line
Coast LineFlag for Canada

asked on

Query of Queries Issues

I have the following query, does not seems to work i am using CF10. it is showing nothing:

<cfquery name = "qryCPTDetails" datasource=#request.DSN# >
      SELECT response as response FROM table WHERE PFORMID=
      (SELECT MAX(PFORMID) FROM pForms WHERE patientId=#patind# and formId=11)
</cfquery>
<cfdump var="#qryCPTDetails#">
<cfquery name = "qryCPTDetailsPending" dbtype="query">
      SELECT * from qryCPTDetails
    where #GetToken(response,2,'ü')# = 'pending'
</cfquery>


string is like this

22208 :  ADL SEGünoncertifiedñ06/23/2013
i tried even using the function inside the cfquery, it still throws error, still lost what causing this
Avatar of Bhavesh Shah
Bhavesh Shah
Flag of India image

m not sure,

but can u try with this one.

SELECT ASCII('ü'),CHAR(252)

<cfquery name = "qryCPTDetailsPending" dbtype="query">
      SELECT * from qryCPTDetails 
    where #GetToken(response,2,CHR(252))# = 'pending'
</cfquery>

Open in new window

Avatar of Coast Line

ASKER

thanks but this is not a related answer, my question why CF functions does not inside cfquery, i know they work, but why not in CF 10. Maybe i am missing something
query of queries have very limited allowed functions. You can't even do things like

left(response)


What are you trying to do?
I think the closest you can get is to use LIKE.  Don't forget QoQ's are case sensitive too

WHERE  lower(response) LIKE <cfqueryparam value"%üpendingü%" cfsqltype="cf_sql_varchar">

Open in new window


query of queries have very limited allowed functions.

Yep. IIRC, the only functions QoQ's supports are:  

* UPPER()
* LOWER()
* CAST()

Maybe one more, but nothing else.
ok, that is limitation of QoQ, why i am unable to use the function inside the cfquery which uses the datasource
you say you are getting an error...please post it
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok, i think i missing something here :

SELECT {fn Left(Title, 50)} As ShortTitle
  FROM mytable

Left is also a CF Function and Left is also in sql [so probably it is referring to the scalar function which is present in sql]

correct me if i am wrong
Correct.  Though they both have left() functions, that statement is using your database's left() function - not the CF #left()# function.
Not that it really matters but I'd point out that my answer that QofQ can't do that is correct....
I agree with Sid. The question was "what's causing this error".  The correct answer is QoQ's don't support it. My remarks just elaborate on that, but the correct answer was already given.