Solved

multiple queries

Posted on 2011-02-27
8
410 Views
Last Modified: 2013-12-19
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 ...
0
Comment
Question by:dgrafx
  • 3
  • 3
  • 2
8 Comments
 
LVL 14

Expert Comment

by:RickEpnet
Comment Utility
I do not believe this is possible can you give us more details on why you want to do this?
0
 
LVL 24

Author Comment

by:dgrafx
Comment Utility
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
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
what error do you receive?
you might want to use a stored procedure instead of having all the SQL in the Coldfusion code ...
0
 
LVL 14

Expert Comment

by:RickEpnet
Comment Utility
I am not familiarly with Oracle will it let you do this? Is it CF that is causing the problem?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 14

Expert Comment

by:RickEpnet
Comment Utility
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
 
LVL 24

Author Comment

by:dgrafx
Comment Utility
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
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
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
 
LVL 24

Author Closing Comment

by:dgrafx
Comment Utility
thanks angel!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now