文件名称:表分区——向分区表中插入数据-oracle数据库操作
文件大小:1.19MB
文件格式:PPT
更新时间:2024-05-16 03:16:17
ppt
表分区——向分区表中插入数据 INSERT INTO ordMast VALUES(‘o001’,to_date(’12-01-19’,’DD-MM-YY’),’V001‘,’p‘,to_date(’12-01-33’,’DD-MM-YY’)); INSERT INTO ordMast VALUES(‘o010’,to_date(’12-02-19’,’DD-MM-YY’),’V001‘,’c‘,to_date(’12-01-33’,’DD-MM-YY’)); INSERT INTO ordMast VALUES(‘o012’,to_date(’12-02-19’,’DD-MM-YY’),’V001‘,’c‘,to_date(’12-01-33’,’DD-MM-YY’)); 单独查询分区 SQL>SELECT * FROM ordMast PARTITION(om2); SQL>SELECT * FROM ordMast PARTITION(om1); CREATE TABLE ordMastNew( orderno VARCHAR2(5) CONSTRAINT prim_new PRIMARY KEY, Odate Date, Vencode VARCHAR2(5) CONSTRAINT fk_vend REFERENCES vendorMaster(vencode), Ostatus CHAR(1) CHECK(ostatus IN (‘p’,’c’)), delDate DATE) PARTITION BY RANGE (orderno,vencode)( PARTITION om1 VALUES LESS THAN(‘o010’,’v010’), PARTITION om2 VALUES LESS THAN(‘o020’,’v020’), PARTITION om3 VALUES LESS THAN(MAXVALUES,MAXVALUEA)); 插入数据 INSERT INTO ordMastNew VALUES(‘o010’,’23-feb-99’,’V001’,’p’,’30-mar-99’); INSERT INTO ordMastNew VALUES(‘o023’,’23-feb-99’,’V002’,’p’,’30-mar-99’);