multiple queries

can one do multiple queries within one call to db?
ex:
update table
set x = 12
where w = 3

select z
from table
where w = 3

I'm using ColdFusion and receive an error if I try and do that
I can however do that with sql server

any input would be appreciated ...
LVL 25
dgrafxAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
I don't do any CF, actually.

well, I have gone through some articles on the net, and all say the same:
you cannot do it with Oracle.

Your best alternative seems be to use multiple CFQUERY tags within a CFTRANSACTION tags (which will make that you use the same connection), which seems to solve your actual concern
0
 
RickEpnetCommented:
I do not believe this is possible can you give us more details on why you want to do this?
0
 
dgrafxAuthor Commented:
why?
the connection to the db is the bottleneck ...
why not connect once - do what you need - select what you need if applicable - then leave ...

instead of connecting more than once
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
what error do you receive?
you might want to use a stored procedure instead of having all the SQL in the Coldfusion code ...
0
 
RickEpnetCommented:
I am not familiarly with Oracle will it let you do this? Is it CF that is causing the problem?
0
 
RickEpnetCommented:
I did not see angelIII comment before I wrote my last one that is what I was going to get to if  Oracle will let you do this.
0
 
dgrafxAuthor Commented:
angel - i know you do some ColdFusion
is it possible to run more than one query within one cfquery block?

don't know right now what the error is - i'm at home
something about syntax

no stored procedures - i do not have permissions on this db to create or modify them
i need to do all querying with cfquery
i know its a bummer but thats life
0
 
dgrafxAuthor Commented:
thanks angel!
0
All Courses

From novice to tech pro — start learning today.