create procedure DBA.p_card_check(@card_no char(16),@fix_no char(16))
----------------------------------------------------------------------------------------
-- 存储过程名:特殊名单测试
-- 功能描述: 检查是否是否为特殊名单
-- 变量说明: @card_no:逻辑卡号 @fix_no:物理卡号
-- 创建人: Alex Chan
-- 创建时间: 2001.12.18
-- 修改时间: 2001.12.22
----------------------------------------------------------------------------------------
as
declare @nid char(16)
declare @nlen char(7)
nld --- type begin
if exists(select* from special_card where nid = @fix_no and nld between 'A' and 'C')
return 99
if exists(select* from special_card where nid = @card_no and nld not between 'A' and 'C' and
nlen = '1')
return 99
if exists(select* from special_card where nld not between 'A' and 'C' and nlen <> '1')
begin tran
declare cu_record cursor for select nid,nlen from special_card where
nld not between 'A' and 'C' and nlen <> '1'
open cu_record
fetch cu_record into @nid,@nlen
while @@sqlstatus = 0
begin
if convert(int,left(@card_no,15)) >= convert(bigint,left(@nid,15)) and
convert(int,left(@card_no,15)) <= convert(bigint,left(@nid,15))+convert(bigint,@nlen)-1
begin
close cu_record
return 99
end
fetch cu_record into @nid,@nlen end
close cu_record
return 0
commint tran
end
/////////////////////////////////////////////////////////////////////
出现的错误提示为
Server Message: Number 195, Severity 15
Procedure 'DBA.p_card_check', Line 37:
'left' is not a recognized built-in function name.
也就是
if convert(int,left(@card_no,15)) >= convert(bigint,left(@nid,15)) and
convert(int,left(@card_no,15)) <= convert(bigint,left(@nid,15))+convert(bigint,@nlen)-1
这一段
求助
----------------------------------------------------------------------------------------
-- 存储过程名:特殊名单测试
-- 功能描述: 检查是否是否为特殊名单
-- 变量说明: @card_no:逻辑卡号 @fix_no:物理卡号
-- 创建人: Alex Chan
-- 创建时间: 2001.12.18
-- 修改时间: 2001.12.22
----------------------------------------------------------------------------------------
as
declare @nid char(16)
declare @nlen char(7)
nld --- type begin
if exists(select* from special_card where nid = @fix_no and nld between 'A' and 'C')
return 99
if exists(select* from special_card where nid = @card_no and nld not between 'A' and 'C' and
nlen = '1')
return 99
if exists(select* from special_card where nld not between 'A' and 'C' and nlen <> '1')
begin tran
declare cu_record cursor for select nid,nlen from special_card where
nld not between 'A' and 'C' and nlen <> '1'
open cu_record
fetch cu_record into @nid,@nlen
while @@sqlstatus = 0
begin
if convert(int,left(@card_no,15)) >= convert(bigint,left(@nid,15)) and
convert(int,left(@card_no,15)) <= convert(bigint,left(@nid,15))+convert(bigint,@nlen)-1
begin
close cu_record
return 99
end
fetch cu_record into @nid,@nlen end
close cu_record
return 0
commint tran
end
/////////////////////////////////////////////////////////////////////
出现的错误提示为
Server Message: Number 195, Severity 15
Procedure 'DBA.p_card_check', Line 37:
'left' is not a recognized built-in function name.
也就是
if convert(int,left(@card_no,15)) >= convert(bigint,left(@nid,15)) and
convert(int,left(@card_no,15)) <= convert(bigint,left(@nid,15))+convert(bigint,@nlen)-1
这一段
求助
解决方案 »
- 关于报表打印的问题,希望大家指教!
- **qiuckrep由横向打印变为纵向打印,纵向打印的字体、方向按照原来的横向设置。很急!!!!****
- 我想按一个F10,让它跳出指定的窗体,
- 如何将内存中一个流读为String,如何把一个字符串转为流,我不要用临时文件的方法
- 今天你散分了没?如今流行散分...我也散~~~up有分
- 问个简单的问题, 给推荐几本学DELHPI的书吧.急急急
- 请问怎样调用Word?
- 现在需要向一台服务器上的一个程序发送数据,它的地址是192.0.0.2,端口是8083,我要加什么控件,可以实现此类操作,我对这个一无所知,
- 请问:怎样才能从数据库中取出N天之内的数据?分很好拿吧!
- 请问谁有制作菜单巨好的工具,要for Delphi6的!急,急,急!!!
- 急急。。。。。。
- 请问Formula One这个问题你碰到过没有?
convert(int,substring(@card_no,1,15)) <= convert(bigint,substring(@nid,1,15))+convert(bigint,@nlen)-1