正在加载图片...
insert text exI(PID, text field) values(104 replicate(我们己取得了雅典 奥运会的的全面胜利!,100) select from text exI 例2: create table text ex2(PId int not null, name char(8), image field lage) insert text ex2(PID, image field) values(104, 0x4ab5435bf556d) select from text ex2 (四)、时间戳型 如果在表中定义了时间戳型的字段,则无论何时添加记录、修改记 录,系统都会向该字段中加入一个计数器值或修改计数器值。 时间戳字段的值为二进制格式的数据,与系统时间没有关系, 它表示对该记录的操作顺序。占8 Bytes 个表中只能有一个时间戳字段。在数据库中,该值保持唯 时间戳字段的值由系统自动确定,不允许用户修改或设置。用 Insert插入数据时,除该字段外的字段需列出,不能全部省略。 时间戳字段可以用于防止多个用户同时修改表的同一记录 例 create table timestamp ex( PID int, name char(8), tis timestamp) insert timestamp ex(PID, name) values(101, cbf1") insert timestamp ex(PID, name) values( 102, cbf2") select from timestamp ex 例2: update timestamp ex6 insert text_ex1(PID,text_field) values(104,replicate('我们已取得了雅典 奥运会的的全面胜利!',100)) go select * from text_ex1 例 2: create table text_ex2(PID int not null,name char(8),image_field image) insert text_ex2(PID,image_field) values(104,0x4ab5435bf556d) go select * from text_ex2 (四)、时间戳型 如果在表中定义了时间戳型的字段,则无论何时添加记录、修改记 录,系统都会向该字段中加入一个计数器值或修改计数器值。 ⚫ 时间戳字段的值为二进制格式的数据,与系统时间没有关系, 它表示对该记录的操作顺序。占 8Bytes。 ⚫ 一个表中只能有一个时间戳字段。在数据库中,该值保持唯一。 ⚫ 时间戳字段的值由系统自动确定,不允许用户修改或设置。用 insert 插入数据时,除该字段外的字段需列出,不能全部省略。 ⚫ 时间戳字段可以用于防止多个用户同时修改表的同一记录。 例 1: create table timestamp_ex(PID int, name char(8), tis timestamp) insert timestamp_ex(PID,name) values(101,'cbf1') insert timestamp_ex(PID,name) values(102,'cbf2') select * from timestamp_ex 例 2: update timestamp_ex
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有