This file contains hidden or 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
%sub = ( | |
">" => sub{ $_[0] > $_[1] }, | |
"<" => sub{ $_[0] < $_[1] }, | |
"=" => sub{ $_[0] == $_[1] }, | |
"!=" => sub{ $_[0] != $_[1] } | |
); | |
$p = $ARGV[0]; # number | |
$r = $ARGV[1]; # operator | |
$q = $ARGV[2]; # number |
This file contains hidden or 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 t_cols_M_to_N as ( | |
select | |
x1.n | |
,x2.* | |
from | |
xmltable( 'for $r in /ROWSET/* | |
return $r' | |
passing | |
dbms_xmlgen.getxmltype( | |
-- you can change query here: |
This file contains hidden or 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 package pkg_redo_gen as | |
cursor c is | |
select | |
b.inst_id, | |
b.sid, | |
b.serial#, | |
b.username, | |
b.machine, | |
b.osuser, | |
b.status, |
This file contains hidden or 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> create table t_nulls as select cast(null as int) col_nulls from dual connect by level<=1e3; | |
Table created. | |
SQL> select count(*) from t_nulls; | |
COUNT(*) | |
---------- | |
1000 |
This file contains hidden or 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> create table t1 as select mod(level,100) a from dual connect by level<=1e4; | |
Table created. | |
Elapsed: 00:00:00.27 | |
SQL> create table t2 as select mod(level,100) b from dual connect by level<=1e4; | |
Table created. | |
Elapsed: 00:00:00.08 |
This file contains hidden or 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> create function xt_fire (p int) return int as | |
2 begin | |
3 dbms_output.put_line('fire '||p); | |
4 return p; | |
5 end; | |
6 / | |
Function created. | |
SQL> set serverout on |
This file contains hidden or 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 table xt1(n1 number,v1 varchar2(1)); | |
create index xt_i1 on xt1(n1,v1); | |
alter table xt1 add constraint uq_xt1 unique (n1,v1) using index xt_i1; | |
create table xt2(a number unique); | |
create bitmap index xt_i2 | |
on xt1(n1,v1) | |
from xt1,xt2 | |
where xt1.n1=xt2.a; |
This file contains hidden or 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
====================================================================== | |
======= Connected to XTENDER@ORCL(orcl)(sol10) | |
======= SID 145 | |
======= SERIAL# 22 | |
======= SPID 3215 | |
====================================================================== | |
SQL> @print_table "select * from dual" | |
ROW_NUM COL_NAME COL_VALUE | |
---------- ------------------------------ --------------------------------------------------------------------- | |
1 DUMMY X |
This file contains hidden or 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> create table tsysdate(dt date); | |
Table created. | |
SQL> create function fsysdate return date as begin return sysdate;end; | |
2 / | |
Function created. | |
SQL> explain plan for select * from tsysdate where fsysdate between dt and dt; |
This file contains hidden or 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 type emp_t as object( | |
employee_id number(6) , | |
first_name varchar2(20), | |
last_name varchar2(25), | |
email varchar2(25), | |
phone_number varchar2(20), | |
hire_date date , | |
job_id varchar2(10), | |
salary number(8,2) , | |
commission_pct number(2,2) , |
OlderNewer