Solved

multiple queries

Posted on 2011-02-27
8
412 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 142

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
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
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 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Bash Script to Analyze Oracle Schemas 11 104
Web Service from a stored procdure oracle 10 55
Oracle - SQL Parse String 5 34
Oracle SQL Select unique values from two columns 4 53
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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 how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to recover a database from a user managed backup

770 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