在vb script中的判断为空的语句,如何在存储过程中判断?
vb script语句如下:
---------------
dim rs,sql
sql="select x from table where id=" &requse.form("id")
rs.open conn,1,1
if (rs.bof and rs.eof) then
response.write "error!"
else
response.write rs("x")
end if
---------------
现有一存储过程:
---------------
create proc sp_index
@id int
as
select isnull(x,'none') from table where id=@id
go
---------------
请问:
怎样用vb script调用存储过程,并使其实现上面的功能?能否这样写:
dim sql
sql="sp_index" &requse.form("id")
conn.execute(sql)
if conn.execute(sql)="none" then
response.write "error!"
else
response.write rs("x")
end if