Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Hi Bracuk,
The name of the page if query1.cfm
And when i preview f12, it dhows the page with the sql statment.
Iam using the following :
running oracle 10g express edition and building my page with macromedia dreamweaver mx 2004
Also runnong coldfusion 9
Thanks.
Sent from my iPhone
Copy link to clipboard
Copied
If it was, you would get an error for having a cfquery without a
name.
The "name" attribute is not required.
And when i preview f12, it dhows the page with the sql statment.
I do not know how DW works, but you need to run the page in your browser, not just "preview" it. ie View http://localhost:8500/query1.cfm
Copy link to clipboard
Copied
-==cfSearching==- wrote:
And when i preview f12, it dhows the page with the sql statment.
I do not know how DW works, but you need to run the page in your browser, not just "preview" it. ie View http://localhost:8500/query1.cfm
IF Dreamweaver is configured properly, that is what F12 is supposed to do. Launch the page in a preview browser. But to do this properly with ColdFusion CFML code:
A) First of all the workstation must have a properly running web server (IIS, Apache, ColdFusion Build-in, etc) properly configured to work with a CFML engine such as Adobe's ColdFusion Application server.
B) The Dreamweaver site must be properly configured with a testing site that will properly put code into a web root in the above configuration and run the code.
I usually don't bother with all of that to get F12 to work properly. I just end up moving the code to the web root and browsing dirctly to the page in a browser.
Copy link to clipboard
Copied
IF Dreamweaver is configured properly, that is what F12 is
supposed to do.
Ah, okay. It sounds like it may not be configured properly then.
Copy link to clipboard
Copied
3- how can i know that CF is running coorectly when i was able to add a DSN succesfully ?
What URL are you using to access CF Administrator? And what URL are you using to browse to the URL that runs that query? it seems odd that your web server is passing the CFAdmin requests to CF, but not other .cfm URLs.
Forget DW, open a browser and browse to the file's URL. What happens then?
--
Adam
Copy link to clipboard
Copied
HI,
I had to uninstall/reinstall COldfusion and have it working.
thanks everybody