1. 写操作(WRITETEXT) 这里一般要用到的函数有TextPtr获得文本字段的指针,和TextVaild检验指针的有效性,@@RowCount判断返回记录的条数。 其基本方法是:用Textptr函数得到指针,判断其有效性,用Writetext写数据 函数说明:Textptr(字段名)。Writetext tablename。Fieldname @textptr(指针) [With Log] data(数据) 例如: Begin Tran Declare @Mytextptr VarBinary(16) Select @mytextptr=textptr(pr_info) From Pub_Info (updlock) Where pud_id=’9999’ IF @Mytextptr Is Not Null Writetext pub_info.pr_info @mytextptr with log ‘data’ Commit Tran 2. 读操作 常用函数 PatIndex(‘%exp%’,var|fieldname。。) Datalength() @@TextSize 文本大小 SettextSize N 设置文本大小 ReadText {TableName。FieldName} {@textptr} Offet Size [HoldLock] 例如: begin tran Declare @mytextptr Varbinary(16),@Totalsize int,@Readsize int,@lastread int Set textsize 100 Select @mytextptr=textptr(pr_info), @totalsize=datalength(pr_info) @lastread=0, @readsize= case when (textsize<datalength(pr_info) then textsize eles datalength(pr_info) end From Pub_info Where Pub_id=’1622’ IF @mytextptr Is not Null and @readsize>0 While (@lastread<@totalsize) ReadText pub_info.pr_info @mytextptr @lastread @readsize holdlock If (@@error<>0) Break Select @lastread=@lastread+@readsize If ((@readsize+@lastread)>@totalsize) Select @readsize=@totalsize-@lastread End Commit Tran 3.数据更新UpdateText 更新数据代替了写操作,其基本语法是: UpdateText Table_Name.Col_Name Text_Ptr Offest(偏移量) Deleted_Length [With Log] [Inserted_Data|Table_Name.Scr_Column_name Str_Text_Ptr] 说明: Offest:0说明从开头开始,Null表示你向当前内容追加数据。 Deleted_Length:0表示不删除任何内容,Null表示删除所有内容。 例如1(完全代替): Declare @mytextptr varbinary(16) Begin tran Select @mytextptr=textptr(pr_infro) from pub_info(uplock) where pub_id=’9999’ If @mytextptr is not null Updatetext pub_info.pr_infro @mytextptr 0 null with log “you are right” Commit 例如2: declare @mytextptr varbinary(16) ,@offest int Begin tran Select @mytextptr=textptr(pr_infro),@offest=patindex(‘%D.C%’,pr_infro)-1+4 /*减一是因为有一个矫正的偏移量,加4是因为D.C.是4*/ from pub_info(unlock) where pub_id=’0877’ If @mytextptr is not null and @offest>=0 Updatetext pub_info.pr_infro @mytextptr @offest null with log Commit tran 例如3: 文本追加的问题 将出版商pub_id=9952的内容追加到出版商Pub_id=0877d的文本中。 Delcare @source_textptr varbinary(16),@target_textptr varbinary(16) Begin tran Select @source_textptr=textptr(pr_infro) from pub_info(uplock) where pub_id=’0877’ Select @target_textptr=textptr(pr_infro) from pub_info(uplock) where pub_id=’9952’ If @source_textptr Is not null and @target I s not null Updatetext pub_info.pr_infro @target_textptr null null with log pub_info.pr_infro @source_textptr 这是一些例子可以看看
我不是bestbestbest,我偷知了她的ID(因为我不想申请帐号)你可以问以下问题: 1、SYBASE FOR IBM RS/6000 UNIX 安装 2、SYBASE FOR SUN SLORIS UNIX 安装 3、SYBASE FOR UNIXWARE 安装 4、SYBASE系统参数设置 5、SYBASE 大表分割且通过分区进行并行处理 6、SYBASE 通过异步预取提高处理速度 7、SYBASE 挂起的修复 8、SYBASE 的并行备份和高速恢复 9、修改sa超级用户的密码(任何平台,即在不具备sso_role权限的时候) 10、恢复master\sybsystemprocs数据库 ... ... ... ... 累了!不敲了!总之你问吧! TMMD,TNND,TYYD。 你们该问的不问我,却乱提问题。 你知道SYBASE公司的MANAGERR是谁?当然,不是我,他是 美国是程守忠 中国是冯星君 亚太是王一明
我别的不要! 只要你拿到答案后,对我说一声“我想献 kiss 给你' 注:男你不限!!! 等着你噢!哦!喔!
i will be right here waiting....
如果你用readtext 可以读取数据!
实际上!我们一般是用前台语言处理的例如ado
这里一般要用到的函数有TextPtr获得文本字段的指针,和TextVaild检验指针的有效性,@@RowCount判断返回记录的条数。
其基本方法是:用Textptr函数得到指针,判断其有效性,用Writetext写数据
函数说明:Textptr(字段名)。Writetext tablename。Fieldname @textptr(指针) [With Log] data(数据)
例如:
Begin Tran
Declare @Mytextptr VarBinary(16)
Select @mytextptr=textptr(pr_info)
From Pub_Info (updlock)
Where pud_id=’9999’
IF @Mytextptr Is Not Null
Writetext pub_info.pr_info @mytextptr with log ‘data’
Commit Tran
2. 读操作
常用函数
PatIndex(‘%exp%’,var|fieldname。。)
Datalength()
@@TextSize 文本大小
SettextSize N 设置文本大小
ReadText {TableName。FieldName} {@textptr} Offet Size [HoldLock]
例如:
begin tran
Declare @mytextptr Varbinary(16),@Totalsize int,@Readsize int,@lastread int
Set textsize 100
Select @mytextptr=textptr(pr_info), @totalsize=datalength(pr_info)
@lastread=0,
@readsize= case when (textsize<datalength(pr_info) then textsize
eles datalength(pr_info)
end
From Pub_info
Where Pub_id=’1622’
IF @mytextptr Is not Null and @readsize>0
While (@lastread<@totalsize)
ReadText pub_info.pr_info @mytextptr @lastread @readsize holdlock
If (@@error<>0)
Break
Select @lastread=@lastread+@readsize
If ((@readsize+@lastread)>@totalsize)
Select @readsize=@totalsize-@lastread
End
Commit Tran
3.数据更新UpdateText
更新数据代替了写操作,其基本语法是:
UpdateText Table_Name.Col_Name Text_Ptr Offest(偏移量) Deleted_Length
[With Log] [Inserted_Data|Table_Name.Scr_Column_name Str_Text_Ptr]
说明:
Offest:0说明从开头开始,Null表示你向当前内容追加数据。
Deleted_Length:0表示不删除任何内容,Null表示删除所有内容。
例如1(完全代替):
Declare @mytextptr varbinary(16)
Begin tran
Select @mytextptr=textptr(pr_infro) from pub_info(uplock) where pub_id=’9999’
If @mytextptr is not null
Updatetext pub_info.pr_infro @mytextptr 0 null with log “you are right”
Commit
例如2:
declare @mytextptr varbinary(16) ,@offest int
Begin tran
Select @mytextptr=textptr(pr_infro),@offest=patindex(‘%D.C%’,pr_infro)-1+4
/*减一是因为有一个矫正的偏移量,加4是因为D.C.是4*/
from pub_info(unlock) where pub_id=’0877’
If @mytextptr is not null and @offest>=0
Updatetext pub_info.pr_infro @mytextptr @offest null with log
Commit tran
例如3:
文本追加的问题
将出版商pub_id=9952的内容追加到出版商Pub_id=0877d的文本中。
Delcare @source_textptr varbinary(16),@target_textptr varbinary(16)
Begin tran
Select @source_textptr=textptr(pr_infro) from pub_info(uplock) where pub_id=’0877’
Select @target_textptr=textptr(pr_infro) from pub_info(uplock) where pub_id=’9952’
If @source_textptr Is not null and @target I s not null
Updatetext pub_info.pr_infro @target_textptr null null
with log pub_info.pr_infro @source_textptr
这是一些例子可以看看
2、SYBASE FOR SUN SLORIS UNIX 安装
3、SYBASE FOR UNIXWARE 安装
4、SYBASE系统参数设置
5、SYBASE 大表分割且通过分区进行并行处理
6、SYBASE 通过异步预取提高处理速度
7、SYBASE 挂起的修复
8、SYBASE 的并行备份和高速恢复
9、修改sa超级用户的密码(任何平台,即在不具备sso_role权限的时候)
10、恢复master\sybsystemprocs数据库
... ... ... ... 累了!不敲了!总之你问吧! TMMD,TNND,TYYD。
你们该问的不问我,却乱提问题。 你知道SYBASE公司的MANAGERR是谁?当然,不是我,他是 美国是程守忠
中国是冯星君
亚太是王一明
我别的不要! 只要你拿到答案后,对我说一声“我想献 kiss 给你' 注:男你不限!!!
等着你噢!哦!喔!
但纯用ASP+SQL Server,此题无解。若用Delphi+SQL Server,一页就行。
纯 ASP 当然也可以实现
rs.fields("ProPicture").AppendChunk(包含图像数据的变量) ' 就可以保存了网页的显示:
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear conChunkSize = 2000
offsize = 0
picsize = pic_rs.fields("propicture").ActualSize
do while offsize < picsize
varchunk = pic_rs.fields("propicture").GetChunk( conChunkSize )
picdata = picdata & Cstr(varchunk)
offsize = offsize + conChunkSize
loop
' 输出图像
if not isempty(picdata) then
Response.ContentType = "image/jpeg" ' 或者 "IMAGE/GIF"
Response.BinaryWrite picdata
end if
Response.End