This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> | |
SQL> create or replace function fd(i number) return number | |
2 deterministic | |
3 as | |
4 begin | |
5 dbms_output.put_line(i); | |
6 return i; | |
7 end; | |
8 / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> | |
SQL> select /*+leading(t3 t2 t1)*/ count(*) | |
2 from test_10_rows t1 | |
3 join test_1m_rows t2 on t1.id = t2.id | |
4 join test_2m_rows t3 on t2.id = t3.id | |
5 / | |
COUNT(*) | |
---------- | |
20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> | |
SQL> whenever sqlerror continue | |
SQL> | |
SQL> drop table test_1 purge; | |
Table dropped. | |
Elapsed: 00:00:00.04 | |
SQL> drop table test_2 purge; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cl scr | |
set echo on | |
drop table test_part_tab purge; | |
drop table test_exch_tab purge; | |
drop table test_exch_tab_no_c2 purge; | |
create table test_part_tab ( | |
pkey int, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace procedure assert( | |
p_condition boolean, | |
p_error_message varchar2 := 'Assert violation!', | |
p_error_code int := -20100 | |
) as | |
begin | |
if p_condition then | |
return; | |
end if; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with | |
one_contact_per_client as ( | |
select --+no_merge | |
client_id, | |
max(decode(c_type, 1, c_info)) keep (dense_rank first order by decode(c_type, 1, created) desc nulls last) as phone, | |
max(decode(c_type, 2, c_info)) keep (dense_rank first order by decode(c_type, 2, created) nulls last) as email | |
from contact | |
where active = 'Y' | |
group by client_id | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> | |
SQL> select banner from v$version; | |
BANNER | |
-------------------------------------------------------------------------------- | |
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production | |
1 row selected. | |
SQL> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21:42:42 SQL> set time off | |
SQL> set timi off | |
SQL> | |
SQL> col banner for a100 | |
SQL> col object_name for a15 | |
SQL> col payload for a150 | |
SQL> col subobject_name for a15 | |
SQL> col trace_filename for a40 | |
SQL> | |
SQL> set lines 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> | |
SQL> alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS' | |
2 / | |
Session altered. | |
SQL> | |
SQL> drop table test_last_ddl purge | |
2 / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> | |
SQL> create table t (id, value) as select 1, 1 from dual | |
2 / | |
Table created. | |
Elapsed: 00:00:00.03 | |
SQL> | |
SQL> var cur_1 refcursor | |
SQL> var cur_2 refcursor |
NewerOlder