Copy link to clipboard
Copied
when running in oracle 10g, this query returns correctly one row:
WITH myResults AS
(
SELECT 1 AS myLevel, 'someString' AS myData
FROM dual
)
SELECT *
FROM myResults;
Returns:
MYLEVEL | MYDATA |
1 | someString |
When put inside a cfquery on a cf9 page, returns nothing!
<cfset qryRan = "false">
<cfif isDefined('myQry.recordCount')>
<cfset qryRan = "true">
</cfif>
Qry: <cfoutput>#qryRan#</cfoutput>
Returns:
Qry: false
yes, the query always had the name attribute set
it was definitely the oracle driver, i've install v10.1 in parallele with 8.1, recreated my datasources and everything works fine now
thanks for the reply
Copy link to clipboard
Copied
I think the problem is with your logic, not the query. Doing this:
<cfquery name="x" datasource="##" username="##" password="##">
WITH myResults AS
(
SELECT 1 AS myLevel, 'someString' AS myData
FROM dual
)
SELECT *
FROM myResults
</cfquery>
<cfdump var="#x#">
Shows the results as expected.
Copy link to clipboard
Copied
thanks but it does the same thing, returns:
Variable X is undefined.
37 : </cfquery>
38 :
39 : <cfdump var="#x#"><cfabort>
i looked at the oracle driver on the cf machine, and it's version 8 (the db is 10g). i'll upgrade the driver and see if it works
thanks
Copy link to clipboard
Copied
If you read the error message, you'll realise none of this is down to Oracle and by no means is that error message "the same thing". Did you add the name="x" attribute to the query? You can't just run half the code and expect it to work.
Copy link to clipboard
Copied
yes, the query always had the name attribute set
it was definitely the oracle driver, i've install v10.1 in parallele with 8.1, recreated my datasources and everything works fine now
thanks for the reply