欢迎来到天天文库
浏览记录
ID:43324194
大小:126.57 KB
页数:14页
时间:2019-09-30
《DB2常用傻瓜问题1000问》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、DB2常用傻瓜问题1000问ThefollowingismainlybasedonDB27・X.ThefollowingcharactersarelowercaseThisarticledoesnotneedtolookatfortheDB2masterAllcharactersarelowercase91.howdoIcreateasummarytableforDB2?TheDB2summarytablefunctionissimilartothematerializedviewofORACLE!Syntaxfor:CREA
2、TESUMMARYTABLETABLE_NAMEAS(FULLSELECT)・・・Suchas:Definesarefreshedsummarytable:CREATESUMMARYTABLETABLE_NAMEAS(SELECT^FROMTABLENAME1WHERECOL1=,'AAA,')DATAINITIALLYDEFERREDREFRESHDEFERREDDATAINITIALLYDEFERREDspecifiesthatdatacannotbeinsertedintothetableaspartoftheCREAT
3、ETABLEstatementREFRESHDEFERREDspecifiesthatthedatainthetablecanberefreshedwhenanyREFRESHTABLEstatementisused!91.howdoIupdatetheprofile?REFRESHTABLESUM_TABLEWhereSUM_TABLEisthesummarytable92.howdoyoumodifythesummarytable?ALTERTABLESUM_TABLE..・93.howdoIcreatetemporary
4、tables?Syntax:DECLAREGLOBALTEMPORARYTABLETABLE_NAMEAS(FULLSELECT)DEFINITIONONLYEXCLUDINGIDENTITYCOLUMNATTRIBLTESONCOMMITDELETEROWSNOTLOGGEDThefirstlinespecifiesthenameofthetemporarytableThesecondlinedefinesthecolumnsofthetemporarytableThethirdlinespecifiesanidentity
5、columnthatisnotcopiedfromthesourceresulttabledefinitionThefourthlinespecifiesthatallrowsofthetablewillbedeletediftheWITHGOLDcursorisnotturnedonThefifthlineprovidesnorecordofchangesinthetableSuchas:DECLAREGLOBALTEMPORARYTABLEDEC_BSEMPMSAS(SELECT^FROMBSEMPMS)DEFINITIO
6、NONLYEXCLUDINGIDENTITYCOLUMNATTRIBUTESONCOMMITDELETEROWSNOTLOGGED91.viewmanagement?Howtocreateviews:CREATEVIEWVIEW_NAMEASSELECT*FROMTABLE_NAMEWHERE...Deleteview:DROPVIEWVIEW_NAME92.howdoIknowthecontentoftheviewdefinition?IntheTEXTcolumninSELECWROMSYSCAT.VIEWS91.howd
7、oIcreatealiases?CREATEALIASALIAS_NAMEFORPRO_NAMEThefollowingPR0_NAMEcanbeTABLE,VIEW,ALIAS,NICKNAME,andsoon92.howtocreatesequences?Suchas:CREATESEQUENCESEQUENCE_NAMESTARTWITHSTART_NUMBERINCREMENTBYVALUE1NOXIAXVALUENOCYCLECACHEMAXIMUMNUMBEROFSEQUENCEVALUESThefirstline
8、specifiesthenameofthesequenceThesecondlinespecifiesthestartvalueofthesequenceThethirdlinespecifiesthemagnitudeofeachnewadditionThefourthli
此文档下载收益归作者所有