473,385 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

loss of performance when using anonymous pl/sql blocks?!

Instead of using a set of different sql-statements i have decided to use
an single, anonymous pl/sql block with host-variables. For example:

DECLARE
cmp NUMBER := :hostvariable;
BEGIN
UPDATE t_sample SET c_id=0 WHERE tid>cmp;
END;

Are there any disadvantages concerning simle update-statement?
Won't oracle cache such blocks, do they need more processing time or
more cpu-power on the server? Or does oracle treat them as any other
sql statement?

thx, markus
Jul 19 '05 #1
2 3484

"Markus Breuer" <ma***********@gmx.de> wrote in message
news:3F**************@gmx.de...
Instead of using a set of different sql-statements i have decided to use
an single, anonymous pl/sql block with host-variables. For example:

DECLARE
cmp NUMBER := :hostvariable;
BEGIN
UPDATE t_sample SET c_id=0 WHERE tid>cmp;
END;

Are there any disadvantages concerning simle update-statement?
Won't oracle cache such blocks, do they need more processing time or
more cpu-power on the server? Or does oracle treat them as any other
sql statement?

thx, markus

The fastest way would be a straight insert with a host variable, keep the
cursor around, rebind and reexecute. If you were inserting a lot of rows at
a time then use the array interface to blast them in 100 or more rows at a
time.
Jim
Jul 19 '05 #2
Markus Breuer <ma***********@gmx.de> wrote in message news:<3F**************@gmx.de>...
Instead of using a set of different sql-statements i have decided to use
an single, anonymous pl/sql block with host-variables. For example:

DECLARE
cmp NUMBER := :hostvariable;
BEGIN
UPDATE t_sample SET c_id=0 WHERE tid>cmp;
END;

Are there any disadvantages concerning simle update-statement?
Won't oracle cache such blocks, do they need more processing time or
more cpu-power on the server? Or does oracle treat them as any other
sql statement?

thx, markus

why dont you run it and find out? Oracle will still cache it. This
shouldnt have any effect on performance.
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Doug Holton | last post by:
Is there any metaclass trick or something similar to allow anonymous code blocks? I'd like to be able to let users do something like this fictitious example: b = Button() b.OnClick =: print...
6
by: Erik Cruz | last post by:
Hi. I have read several articles recommending avoid to raise exceptions when possible, since exceptions are expensive to the system. Removing code from Try... Catch blocks can help performance?...
4
by: zzfreddybb | last post by:
We are using HP aCC compiler on a HP Itanium box ( 11.23) We are having some severe performance hits using exception handling ( try/catch ) scenarios. The online aCC documentation says: HP...
9
by: Java script Dude | last post by:
In many languages, it is necessary to string together multiple strings into one string for use over multiple lines of code. Which one is the most efficient from the interpreters perspective: ...
18
by: zebi | last post by:
hello, What's your opinion : The best type of temporary tablespace (DB2V7.2 SP 7 in AIX 4.3 / multiprocessor ) is DMS ou SMS ? Thanks ZEB
6
by: RepStat | last post by:
I've read that it is best not to use exceptions willy-nilly for stupid purposes as they can be a major performance hit if they are thrown. But is it a performance hit to use a try..catch..finally...
4
by: serge | last post by:
I am doing a mass update of our SQL script files by adding dbo. to all references to the tables. The code is also adding dbo. in front of existing lines of code that are like this: SELECT...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
2
by: Markus Breuer | last post by:
Instead of using a set of different sql-statements i have decided to use an single, anonymous pl/sql block with host-variables. For example: DECLARE cmp NUMBER := :hostvariable; BEGIN UPDATE...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.