Skip to main content
Participant
April 20, 2011
Question

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

  • April 20, 2011
  • 2 replies
  • 1375 views

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 has been closed for replies.

2 replies

Inspiring
April 20, 2011

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?

Participant
April 20, 2011

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

Inspiring
April 21, 2011

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?

Inspiring
April 20, 2011

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