Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: 10g Bind peeking causes multiple cursors for same query with perl DBD::Oracle
>From my testing it's not the same in sqlplus.
First I updated the table to include 3 records with distinct date_left
columns. Just to make it easier to test.
DATE_LEFT
11/28/05 12:13 11/29/05 15:30 11/30/05 19:22
Then I setup my test script which I will show you shortly, but I also executed the following query to give me the total parse and hard parses before and after my query block.
QUERY1:
select decode(statistic#,299,'Total parse count (299)',
300,'Hard parse count (300)',statistic#)statistic#,
value from v$mystat where statistic# in (299,300)
So QUERY1 was executed before and after my little script...
Here is the actual sql block.
DECLARE
col1 varchar2(10);
col2 varchar2(10);
BEGIN
for x in (select to_char(date_left,'YYYYMMDD')dt from PETER_T1)
LOOP
SELECT /*SQL-TEST4 */ column1,column2 INTO col1,col2 FROM PETER_T1 WHERE DATE_LEFT BETWEEN TO_DATE(x.dt, 'YYYYMMDD') AND TO_DATE(x.dt || ' 235959', 'YYYYMMDD HH24MISS');END LOOP;
--peter Received on Fri Dec 02 2005 - 11:22:16 CST