[求助]image类型(里面保存的是文本)如何检索?
<p><font face="verdana, arial, helvetica" size="2"><span class="javascript" id="text8183293" style="FONT-SIZE: 12px;">各位高手<br/>因文本全部以image类型保存,现在要实现其内容检索,无法实现,请各位支招,谢谢!<br/><br/>我在网上找到sql2000的实现办法,但在sybase下通不过!<br/><br/>declare @t table(img image) <br/>insert @t select cast(N'as;dfjsadl;fjasl;djf **** askdfl;asjd' as varbinary(8000)) <br/>union all select cast(N'as;dfjsadl;fjasl;djf **** askdfl;asjd' as varbinary(8000)) <br/><br/>--查询 <br/>declare @str nvarchar(10) <br/>set @str=N'abc' --搜索abc <br/><br/>select 位置=charindex(cast(@str as varbinary(8000)),img) <br/>from @t <br/>where charindex(cast(@str as varbinary(8000)),img)>0 <br/><br/>=================================================<br/>declare @str varbinary(1000) <br/>set @str = cast(N'china' as varbinary(1000))<br/>select * from aaaa<br/>where charindex(@str,bbbb)>0<br/>出错信息如下<br/>Server Message: Number 11021, Severity 16<br/>Server 'SYBASE', Line 3:<br/>Function CHARINDEX invoked with wrong number or type of argument(s).</span></font></p>
页:
[1]