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
drop table test_pk purge | |
create table test_pk( | |
n_pk number not null, | |
n_val number, | |
constraint test_pk_pk primary key (n_pk)) | |
create table test_reference( | |
n_pk number not null, |
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 table tab_with_arr( | |
id number, | |
val NUMBER_ARRAY) | |
insert into tab_with_arr | |
select 1, number_array(1,2,4,5) | |
from dual | |
select t.id, c.column_value |
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 TYPE NUMBER_ARRAY AS VARRAY(2) OF NUMBER | |
create table tab_with_arr( | |
id number, | |
val NUMBER_ARRAY) | |
insert into tab_with_arr | |
select 1, number_array(1,2,3,4,5) | |
from dual |
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
SELECT SUBSTR('123232', 1, LENGTH('123232') - LEVEL + 1), | |
LENGTH('123232') - LEVEL + 1 N_PREFIX_LENGTH | |
FROM DUAL | |
CONNECT BY SUBSTR('123232', 1, LENGTH('123232') - LEVEL + 1) IS NOT NULL |
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
DECLARE | |
BEGIN | |
IF NOT (1 = NULL) THEN | |
RAISE_APPLICATION_ERROR(-20100, 'Not works!'); | |
END IF; | |
-- it's not working obviously | |
END; | |
/ |
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
DECLARE | |
rc_Address SI_ADDRESSES%ROWTYPE; | |
PROCEDURE DO_IT_WITH_ADDRESS( | |
rc_Address SI_ADDRESSES%ROWTYPE) | |
IS | |
BEGIN | |
RAISE_APPLICATION_ERROR(-20100, 'Yea, doin'' it with address ' || rc_Address.N_ADDRESS_ID); | |
END DO_IT_WITH_ADDRESS; | |
BEGIN |
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
DECLARE | |
vch VARCHAR2(30); | |
FUNCTION GET_COMMON_PREFIX( | |
vch_VC_START IN VARCHAR2, | |
vch_VC_END IN VARCHAR2) | |
RETURN VARCHAR2 | |
IS | |
num_Length NUMBER; | |
vch_Start VARCHAR2(30); |
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 table million_rows (no number) | |
/ | |
insert into million_rows select level from dual connect by level <= 200000 | |
/ | |
insert into million_rows select 200000 + level from dual connect by level <= 200000 | |
/ | |
insert into million_rows select 400000 + level from dual connect by level <= 200000 | |
/ | |
insert into million_rows select 600000 + level from dual connect by level <= 200000 | |
/ |
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 type varchar2_500_table as table of varchar2(500) | |
/ | |
create type varchar2_500_table_2 as table of varchar2(500) | |
/ | |
create table tab1 ( | |
id number, | |
vch varchar2(500), | |
nt varchar2_500_table) | |
nested table nt store as tab1_nt | |
/ |
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
DECLARE | |
num_Check NUMBER; | |
BEGIN | |
SELECT SIGN(COUNT(*)) | |
INTO num_Check | |
FROM ALL_XML_SCHEMAS | |
WHERE OWNER = 'AIS_NET' | |
AND SCHEMA_URL = 'http://localhost/xdb/latera/hydra/provisioning/timewrapper.xsd'; | |
IF num_Check > 0 THEN |
NewerOlder