Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to connect to data source (newbie q)

Status
Not open for further replies.

tektipforager

Programmer
Oct 5, 2010
2
0
0
GB
I'm just starting to learn ColdFusion. I've installed the CF 9 free developers edition, with built-in web server, onto XP home edition. It's working OK - I can run basic code with simple tags.

I want to run a CFQUERY against an Oracle 10g express edition. I've added an Oracle data source which verified OK, but when I try a CFQUERY it has no effect - no errors, nothing.

Assuming the problem was with Oracle, I tried to cfquery against demo data that came with CF9 (cfdocexample on apache derby embedded) which also verifies OK. Same result - as if the cfquery is just ignored.

Is there some obvious step I've missed out?

 
If there was a problem with the datasource or SQL, you would probably be getting an error instead of "nothing". Stupid question, but is the code actually doing anything to display the results? ie Using CFDUMP or CFOUTPUT?

Try running this sample against the "cfdocexamples" database. The CFDUMP should show about 20+ records
Code:
<cfquery name = "GetSals" datasource = "cfdocexamples"> 
    SELECT * FROM Employee 
    ORDER BY LastName 
</cfquery>
<cfdump var="#GetSals#">




----------------------------------
 
Not a stupid question! there was no code to display the results!

Everything is working fine. (Well, cfdump works, so the only thing stopping me now is me....)

I'm amazed how easy it has been to set up the Oracle database and configure ColdFusion to use it as a datasource.

Thanks cfSearching
 
Yes, simplicity is one CF's strengths. Even some of the more complex stuff is much easier to achieve in CF than in other languages. At least IMHO ;-)

Anyway, glad I could help. If you have any other questions, just let us know!



----------------------------------
 
I have always considered CF as HTML on steriods. It definately can make coding easier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top