create table test_tbl (ts_col timestamp(0), n_col number)
Table created.
create or replace function f ( p int )
return int as
begin
return p;
end f;
Function created.
declare
l_cnt pls_integer := 0;
begin
for c_rec in (
select /*+ findme_plsql */
*
from test_tbl
where ts_col >= to_timestamp('01-MAR-19', 'dd-MON-yy')
and ts_col < to_timestamp('31-MAR-19', 'dd-MON-yy') + 1
and ts_col < date'2019-03-31'
and n_col = 1
and f ( 1 ) = 1
)
loop
l_cnt := l_cnt +1;
end loop;
dbms_output.put_line('how many='||l_cnt);
end;
Statement processed.
how many=0
select sql_fulltext,sql_id
from v$sql
where upper(sql_fulltext) like 'SELECT /*+ FINDME%'
SQL_FULLTEXT | SQL_ID | SELECT /*+ findme_plsql */ * FROM TEST_TBL WHERE TS_COL >= TO_TIMESTAMP('01-MAR-19', 'dd-MON-yy') AND TS_COL < TO_TIMESTAMP('31-MAR-19', 'dd-MON-yy') + 1 AND TS_COL < DATE'2019-03-31' AND N_COL = 1 AND F ( 1 ) = 1 | 2umm803usx9xy |
---|