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 TEST_LOCK_QUERIES( | |
ID NUMBER, | |
NAME VARCHAR2(64)) | |
/ | |
ALTER TABLE TEST_LOCK_QUERIES | |
ADD CONSTRAINT PK_TEST_LOCK_QUERIES PRIMARY KEY (ID); | |
/ | |
INSERT INTO TEST_LOCK_QUERIES(ID, NAME) VALUES(1, 'Bob') | |
/ | |
INSERT INTO TEST_LOCK_QUERIES(ID, NAME) VALUES(2, 'Alice') |
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_N_WRITEOFF_SUM NUMBER; | |
BEGIN | |
EXECUTE IMMEDIATE ' | |
SELECT NVL(SUM(GM.N_SUM), 0) | |
FROM SD_GOOD_MOVES GM, | |
(SELECT GMT.N_DOC_ID, | |
D.N_DOC_ID N_D_DOC_ID, | |
DS.N_DOC_ID N_DS_DOC_ID | |
FROM SD_DOCUMENTS D, |
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
-- estimation storage table | |
CREATE TABLE ISSUE_ESTIMATION( | |
N_ESTIMATION_ID NUMBER, | |
VC_PREDICTOR VARCHAR2(64) NOT NULL, | |
VC_ISSUE VARCHAR2(64) NOT NULL, | |
N_ESTIMATION NUMBER NOT NULL, | |
D_ESTIMATION DATE NOT NULL); | |
ALTER TABLE ISSUE_ESTIMATION | |
add constraint PK_ISSUE_ESTIMATION primary key (N_ESTIMATION_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
create or replace type id_list as table of number | |
/ | |
create table test_nested( | |
id number primary key, | |
ids id_list | |
) | |
nested table ids store as nested_ids | |
/ | |
insert into test_nested(id, ids) | |
values (1, id_list(1, 2, 3)) |
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 wide AS OBJECT( | |
num NUMBER, | |
vch VARCHAR2(4000)) | |
create or replace type wide_table as table of wide | |
create table SD_DISCOUNT_SERVICES | |
( | |
N_DISCOUNT_SERVICE_ID 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
-- Bulk collect leaves collection NOT NULL when no rows got | |
DECLARE | |
nt NUMBER_TABLE; -- does not change if you initialize it like ':= NUMBER_TABLE()' | |
BEGIN | |
SELECT 1 | |
BULK COLLECT INTO nt | |
FROM DUAL | |
WHERE 1 = 2; | |
IF nt IS NULL THEN |
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 | |
tbl_Args NUMBER_TABLE := NUMBER_TABLE(); | |
BEGIN | |
RAISE_APPLICATION_ERROR(-20100, tbl_ARGS.COUNT); -- 0 | |
END; | |
/ | |
DECLARE | |
tbl_Args NUMBER_TABLE := NUMBER_TABLE(); | |
BEGIN | |
tbl_ARGS.EXTEND(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
declare | |
nt NUMBER_TABLE := NUMBER_TABLE (1, 2, 3); | |
num_DUM NUMBER; | |
BEGIN | |
WITH d AS ( | |
SELECT 1 DUM | |
FROM DUAL) | |
SELECT D.DUM | |
INTO num_DUM | |
FROM D, |
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_SG SI_SUBJ_GOODS%ROWTYPE; | |
BEGIN | |
rc_SG.N_SUBJ_GOOD_ID := -1; | |
BEGIN | |
SELECT * | |
INTO rc_SG | |
FROM SI_SUBJ_GOODS | |
WHERE 1 = 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
CREATE DIRECTORY HYDRA_TMP_DIR AS '/tmp/hydra_files' | |
/ | |
CREATE TABLE EX_ACCOUNTING_DATA( | |
N_FIRM_ID NUMBER, | |
N_GOOD_ID NUMBER, | |
N_OBJECT_ID NUMBER, | |
N_USER_ID NUMBER, | |
VC_EXT_ID VARCHAR2(1000), | |
D_BEGIN DATE, | |
D_END DATE, |
OlderNewer