multiple queries

Posted on 2011-02-27
Last Modified: 2013-12-19
can one do multiple queries within one call to db?
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 ...
Question by:dgrafx
  • 3
  • 3
  • 2
LVL 14

Expert Comment

ID: 34991860
I do not believe this is possible can you give us more details on why you want to do this?
LVL 25

Author Comment

ID: 34991948
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
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 ...
LVL 14

Expert Comment

ID: 34992059
I am not familiarly with Oracle will it let you do this? Is it CF that is causing the problem?
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

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.
LVL 25

Author Comment

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

Accepted Solution

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
LVL 25

Author Closing Comment

ID: 34992466
thanks angel!

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Encryption Decryption in Oracle 12 107
PAYER_ID has both atributes 4 31
C# Connection String for Oracle database is not working 22 93
Oracle Next Available Number 2 32
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
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.

896 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

14 Experts available now in Live!

Get 1:1 Help Now