Query with variables very slow
Good morning,
I tried to Google finding similar problems, I found them, but I didnt' find a solution.
Basically I have a stored procedure that use a cursor to retrive some values and use each one to made a query...but cursor are working fine...
If I insert something like:
SELECT fields FROM table WHERE field1='VALUE'
this query take less that 100 msec to return values.
Instead if I made somethink like:
DECLARE value VARCHAR(50);
SET value='VALUE';
SELECT fields FROM tables WHERE field1=value
should be the same, but this query take about 4 seconds...
Someone had a similar problem and found a solutions?
Thanks in advance
Gianni
Subject
Views
Written By
Posted
Query with variables very slow
2433
January 27, 2012 10:38PM
1172
January 28, 2012 06:41PM
2185
January 28, 2012 10:16PM
1260
January 29, 2012 07:09PM
1280
January 30, 2012 02:18AM
1289
January 30, 2012 03:39AM
1131
January 31, 2012 03:20AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.