create table 表名稱 as (子查詢)例子: 複製oracel安裝後的預設資料庫scott中的表empcreate table myemp as (select * from emp);此例是表示表結構和表內容一起複製過來了。二、複製表結構create table 表名稱 as (子查詢 where 1=2) ,即在上述的基礎上加入了一個永遠不可能成立的條件(1=2),則此時表示的是只複製表結構,但不複製表的內容。 create table myemp2 as (select *
oracle中儲存表中的屬性名稱的系統資料表是dba_tab_columns;可以從這個表中查處所有的屬性名稱,set pagesize 0 --設定頁面大小,0表示無限制,如果設定為10,則10行資料後一個空行; set num 18;設定數位長度,如果不夠大則用科學計數法; set heading off;設定不要題頭, set feedback off;設定不需要返回資訊; set term off; set trimspool on; spool c:/data.txt; @sql/10
create or replaceTRIGGER "USER_TRIGGER"AFTER INSERT OR DELETE OR UPDATE ON USERS -- 對應三種觸發事件FOR EACH ROW --行級觸發器BEGIN if inserting then insert into USERS2 values(:new.lid,:new.strname,:new.straddress); elsif deleting then delete from
對於大資料量的insert into select的做法,我個人來說不贊成這樣做,現實也沒這樣做,對此,我通過oracle的預存程序寫了個大資料量的insert into select 的分批插入方法,代碼如下 create or replace procedure largedata_insert(ip_table_name in varchar2, --目標表 ip_table_column in
--建立測試資料create table a(id number);create table b(id number);insert into a values(1);insert into a values(2);insert into a values(3);insert into b values(1);insert into b values(2);insert into b values(4);commit;--左:--主流資料庫通用的方法select * from a left
update table_test set description='explain for tablespace' where name='yjip';當你發出這條語句給oracle後, oracle會用到這些tablespace:1. where條件如果引用了index or other條件導致產生排序操作, 這時會用到TEMP tablespace;2. oracle收到這條語句後,會申請一塊undo塊來存放原先的資料,以便rollback時用,用的是undo tablespace;3.