Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

multiple queries

Posted on 2011-02-27
8
Medium Priority
?
419 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
ID: 34991860
I do not believe this is possible can you give us more details on why you want to do this?
0
 
LVL 25

Author Comment

by:dgrafx
ID: 34991948
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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34992024
what error do you receive?
you might want to use a stored procedure instead of having all the SQL in the Coldfusion code ...
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 14

Expert Comment

by:RickEpnet
ID: 34992059
I am not familiarly with Oracle will it let you do this? Is it CF that is causing the problem?
0
 
LVL 14

Expert Comment

by:RickEpnet
ID: 34992067
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 25

Author Comment

by:dgrafx
ID: 34992088
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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 34992329
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 25

Author Closing Comment

by:dgrafx
ID: 34992466
thanks angel!
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Suggested Courses

824 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