ASP.NET学习社区ASP.NET学习区有问有答 SQL语句能否包含子程序调用?

1  /  1  页   1 跳转 查看:485

SQL语句能否包含子程序调用?

SQL语句能否包含子程序调用?



Function GotTopic(Str,StrLen)
Dim l,t,c, i,LableStr,regEx,Match,Matches
If StrLen=0 then
GotTopic=""
exit function
End If
if IsNull(Str) then
GotTopic = ""
Exit Function
end if
if Str = "" then
GotTopic=""
Exit Function
end If
Str=Replace(Replace(Replace(Replace(Str," "," "),""",Chr(34)),">",">"),"<"," <")
l=len(str)
t=0
strlen=Clng(strLen)
for i=1 to l
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
GotTopic=left(str,i)
exit for
else
GotTopic=str
end if
Next
GotTopic = Replace(Replace(Replace(Replace(GotTopic," "," "),Chr(34),"""),">",">")," <","<")
End Function

Sql = "select * from tb where dbo.f_GotTopic(content,3)='123'"


这种不行.我想问的是SQL语句中可以包含自定义函数.这个自定义函数.只能写在存储过程里吗?
像上面的用VBSCRIPT写的不能用吗?
 

回复:SQL语句能否包含子程序调用?

是不可以的,只能在存储过程中
 

回复:SQL语句能否包含子程序调用?

不太明白你的意思。
VBSCRIPT写的函数怎么用sql调用?不能吧。
mssql数据库中可以自定义函数,这个函数可以在sql语句或存储过程中调用。但用其他语言 vb,c#等写的函数,sql无法直接调用啊。access数据库中好象支持一些vb语法,不过详细内容 我也不太清楚。
http://www.Aspx1.Com
请帮忙宣传Aspx1 , Aspx1是ASP.NET学习者的家园 , 适宜长期居住.
 

回复:SQL语句能否包含子程序调用?

access支持vb语法其实还是vbscript写的宏。。。
 
1  /  1  页   1 跳转

版权所有 ASP.NET学习门户 2.0.1214   Sitemap  

返顶部