94. 如何創(chuàng)建臨時(shí)表? 語法: declare global temporary table table_name as (fullselect) definition only excluding identity column attributes on commit delete rows not logged 第一行規(guī)定臨時(shí)表的名稱. 第二行規(guī)定臨時(shí)表的列的定義. 第三行規(guī)定不是從源結(jié)果表定義中復(fù)制的恒等列. 第四行規(guī)定如果沒有打開with gold光標(biāo),將會(huì)刪除表的所有行. 第五行規(guī)定不對(duì)表的改變進(jìn)行記錄. 例如: declare global temporary table dec_bsempms as (select * from bsempms) definition only excluding identity column attributes on commit delete rows not logged
95. 視圖的管理? 如何創(chuàng)建視圖: create view view_name as select * from table_name where ... 刪除視圖: drop view view_name
96. 如何知道視圖定義的內(nèi)容? select * from syscat.views中的text列中.
97. 如何創(chuàng)建別名? create alias alias_name for pro_name 后面的pro_name可以是table,view,alias,nickname等.
98. 如何創(chuàng)建序列? 例如: create sequence sequence_name start with start_number increment by value1 nomaxvalue nocycle cache maximum number of sequence values 第一行規(guī)定序列的名稱. 第二行規(guī)定序列的開始數(shù)值. 第三行規(guī)定每次新增的幅度. 第四行規(guī)定沒有最大數(shù)值限制. 第五行規(guī)定最大數(shù)值限制.
99. 如何更改序列? alter sequence sequence_name ... 可以修改的參數(shù) start with 的 start_number increment 的 value1 nomaxvalue的數(shù)值 nocycle屬性 maximum number of sequence values 最大數(shù)值