Coast Line
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/201 3
i tried even using the function inside the cfquery, it still throws error, still lost what causing this
<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,'ü')#
</cfquery>
string is like this
22208 : ADL SEGünoncertifiedñ06/23/201
i tried even using the function inside the cfquery, it still throws error, still lost what causing this
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?
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
Yep. IIRC, the only functions QoQ's supports are:
* UPPER()
* LOWER()
* CAST()
Maybe one more, but nothing else.
WHERE lower(response) LIKE <cfqueryparam value"%üpendingü%" cfsqltype="cf_sql_varchar">
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.
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
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.
but can u try with this one.
Open in new window