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

simple oracle query not working in cf9

Participant ,
Mar 28, 2012 Mar 28, 2012

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:

MYLEVELMYDATA
1someString

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

TOPICS
Database access

Views

1.1K

Translate

Translate

Report

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

correct answers 1 Correct answer

Participant , Mar 29, 2012 Mar 29, 2012

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

Votes

Translate

Translate
Guide ,
Mar 29, 2012 Mar 29, 2012

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.

Votes

Translate

Translate

Report

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
Participant ,
Mar 29, 2012 Mar 29, 2012

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

Votes

Translate

Translate

Report

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
Guide ,
Mar 29, 2012 Mar 29, 2012

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.

Votes

Translate

Translate

Report

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
Participant ,
Mar 29, 2012 Mar 29, 2012

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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
Documentation