Skip to main content
Participant
Apr 20, 2011 8:41 PM UTC
Question

Help for a newbie : cfquery return the SQL Statement as text

Hi All,

After installing Coldfusion ( build in web server) and Oracle database 10g express edition

i am trying to do some basic test on how to query table data using coldfusion datasource name.

I have been successfully able to create a DSN = ORA1 with status OK.

when i tried to print out the data using coldfusion code :

<cfquery datasource="ORA1">
  select * from ROGRAM ;
</cfquery>

when i run the above code i got the follwwing on the browserr:

select * from ROGRAM ;


any help on that will be appreciated.

thanks
This topic is closed to new replies. Start a new post to keep the conversation going.

10 replies

Inspiring
Apr 20, 2011 9:24 PM UTC

when i run the above code i got the follwwing on the

browserr:

select * from ROGRAM ;

A basic cfquery should not produce any output. It sounds as if your CF code is being rendered as html instead of being executed on the server.

Are you running that code from a .cfm page and are you sure CF is installed correctly?

Translate
Participant
Apr 20, 2011 11:16 PM UTC

hi guys,

thanks fot the quick answers :

1-  i have removed the semi-colon and still the same issue.

2- i am running from a cfm page.

3- how can i know that CF is running coorectly when i was able to add a DSN succesfully ?

ANy other suggestions please ?

thanks

Translate
Inspiring
Apr 21, 2011 12:53 AM UTC

Coldfusion is not running when you run your page.  If it was, you would get an error for having a cfquery without a name.

What is the file extension of this page?

Translate
Inspiring
Apr 20, 2011 9:08 PM UTC

Lose the semi-colon. It's not part of the SQL statement, it's a statement separator (and it's client-specific). As CFQUERY is just passing one statement, it's inappropriate.

--

Adam

Translate