日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

sybase函数学习(八)

發(fā)布時(shí)間:2025/3/15 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 sybase函数学习(八) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1.alter database? 增加分配給數(shù)據(jù)庫(kù)的控件量<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

alter database mydb on mydate =50?????--(在數(shù)據(jù)庫(kù)設(shè)備mydb 上加<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />50m數(shù)據(jù)空間,)
??????????????????????????????????log on mylog=10????? --(
在數(shù)據(jù)庫(kù)設(shè)備mylog上加10m日志空間,)

?

2.alter role? 定義角色之間的互斥關(guān)系;為角色添加,刪除和更改口令;指定口令有效期,最小口令長(zhǎng)度以及知道角色允許的最大登陸嘗試失敗次數(shù).

例子1:intern_rolespecialist_role定義為互斥:

alter role specialist_role add exclusive membership intern_role

?

?

例子2:在成員資格級(jí)別和激活級(jí)別將角色定義為互斥

alter role specialist_role add exclusive membership intern_role

alter role intern_roleadd add exclusive activation surgeon_role

?

例子3:添加口令到現(xiàn)有的角色

alter role doctor_role add password “zhang”

?

例子4:從現(xiàn)有角色刪除口令

alter role doctor_role drop password

?

例子5:鎖定角色physician_role

alter role physician_role? lock

?

例子6:解鎖角色physician_role

alter role physician_role? unlock

?

例子7:physician_role允許的最大登陸嘗試失敗次數(shù)改為5

alter role physician_role set max failed_logins 5

?

例子8:將現(xiàn)有角色physician_role最短口令長(zhǎng)度設(shè)置為5個(gè)字符

alter role physician_role set min password length 5

?

例子9:替換所有角色的最短口令長(zhǎng)度

alter role “all overrides”? set min password length-1

?

例子10 刪除所有角色的最大登陸失敗次數(shù)的替換值

alter role? “all overrides”? set max password length-1

?

注意:一般為角色更改口令,請(qǐng)先刪除口令,在添加口令.

?

3.alter table 向表添加新列;刪除或修改現(xiàn)在的列;添加,更改或刪除約束;更改現(xiàn)有表的屬性;啟用或禁用表上的觸發(fā)器;

例子1:向表中添加一列

alter table tablename add? manager_name varchar(50) null

?

例子2: 向表中添加identity

alter table tablename add? user_id? numeric(19,0) identity

?

例子3 向表中添加主鍵約束.

alter table? autors add? constraint? au_identification primary key(au_id,au_lname,au_fname)

?

例子4 authors表上創(chuàng)建索引,設(shè)置reservepagegap值為16,在索引中為每15個(gè)分配的頁(yè)留一個(gè)空白頁(yè)

alter table? authors

add constraint au_identification

primary key(au_id,au_lname,au_fname)

with reservepagegap=16

?

例子5 刪除au_identification約束

alter table tablename

drop constraint au_identification

?

例子6 刪除authors表中phone列的缺省約束.如果列允許為空值,則沒有指定值時(shí)會(huì)插入空值.如果列不允許空值,則不指定列的插入,操作將失敗

alter table? authors

replace? phone default null

?

例子7:為表創(chuàng)建4個(gè)新的頁(yè)鏈.將表分區(qū)后,現(xiàn)有的數(shù)據(jù)會(huì)保存在第一個(gè)分區(qū),但是新的行會(huì)插入到所有這5個(gè)分區(qū)中

alter table tablename? partition 5

?

例子8 并置表的所有頁(yè)鏈,然后將其重新分區(qū)為6個(gè)分區(qū)

alter table tablename? unpartition

alter table tablename? partition 6

?

例子9 tablename表的鎖定方案更改為數(shù)據(jù)行鎖定

alter table tablename lock datarows

?

例子10 將非空列author_type 添加到缺省值為primary_authorauthors

alter table authors

add author_type varchar(20)

default “primary_author”? not null

?

例子11 從表中刪除列

alter table tablename

drop id,name

?

例子12 將表authorscity列修改為默認(rèn)值為空值的varchar(30)

alter table authors

modify city varchar(30)? null

?

例子13 stores表中的name列修改為非空.

alter table stores

modify name not null

?

例子14 修改titles表的type,并將titles表的鎖定方案從所有頁(yè)鎖定更改為數(shù)據(jù)行鎖定

alter? table titles

modify type varchar(10)

lock datarows

?

例子15 titles表的notes列由varchar(50),將缺省值由空更改為非空,并知道exp_row_size值為40

alter table titles

modify notes varhcar(50)? not null

with? exp_row_size=40

?

例子16 添加,修改和刪除一列,然后在同一查詢中添加另一列.改變鎖定方案,并指定新列的exp_row_size.

alter table titles

modify city varhcar(50)?? null

drop notes

add sec_advance money default 1000 not null

lock datarows

with? exp_row_size=40

?

轉(zhuǎn)載于:https://www.cnblogs.com/zyl-8183/archive/2006/12/28/606441.html

新人創(chuàng)作打卡挑戰(zhàn)賽發(fā)博客就能抽獎(jiǎng)!定制產(chǎn)品紅包拿不停!

總結(jié)

以上是生活随笔為你收集整理的sybase函数学习(八)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。