L
Lets go!
Unregistered / Unconfirmed
GUEST, unregistred user!
有一存儲過程如下:
CREATE procedure sp_MSupd_BUYER
@c1 char (10) ,@c2 char (30) ,@c3 char (15) ,@c4 char (4) ,@c5 char (10) ,@c6 char (10) ,@c7 numeric (2, 0),@pkc1 char (10),@bitmap binary(1)
as
if
substring(@bitmap,1,1) & 1 = 1
update BUYER set
BUYER = case substring(@bitmap,1,1) & 1 when 1 then @c1 else BUYER end
,BUYER_NAME = case substring(@bitmap,1,1) & 2 when 2 then @c2 else BUYER_NAME end
,PHONE = case substring(@bitmap,1,1) & 4 when 4 then @c3 else PHONE end
,COMP_CODE = case substring(@bitmap,1,1) & 8 when 8 then @c4 else COMP_CODE end
,ZUSER = case substring(@bitmap,1,1) & 16 when 16 then @c5 else ZUSER end
,COUNTRY = case substring(@bitmap,1,1) & 32 when 32 then @c6 else COUNTRY end
,REPLSVR = case substring(@bitmap,1,1) & 64 when 64 then @c7 else REPLSVR end
where BUYER = @pkc1
else
update BUYER set
BUYER = case substring(@bitmap,1,1) & 1 when 1 then @c1 else BUYER end
,BUYER_NAME = case substring(@bitmap,1,1) & 2 when 2 then @c2 else BUYER_NAME end
,PHONE = case substring(@bitmap,1,1) & 4 when 4 then @c3 else PHONE end
,COMP_CODE = case substring(@bitmap,1,1) & 8 when 8 then @c4 else COMP_CODE end
,ZUSER = case substring(@bitmap,1,1) & 16 when 16 then @c5 else ZUSER end
,COUNTRY = case substring(@bitmap,1,1) & 32 when 32 then @c6 else COUNTRY end
,REPLSVR = case substring(@bitmap,1,1) & 64 when 64 then @c7 else REPLSVR end
where BUYER = @pkc1
================================
通過比較字段是否被修改來在SERVER端對相應的資料表進行修改。
但無法將程序中的BINARY變量直接賦給存儲過程的參數@BITMAP上。
請教各位先進,有無解決辦法?
在DELHPI6中進行編譯時,
針對存儲過程parameters.ParamByName('@bitmap').value值是variant類型
而我的BINARY變量是BINARY類型。無法直接賦值。
CREATE procedure sp_MSupd_BUYER
@c1 char (10) ,@c2 char (30) ,@c3 char (15) ,@c4 char (4) ,@c5 char (10) ,@c6 char (10) ,@c7 numeric (2, 0),@pkc1 char (10),@bitmap binary(1)
as
if
substring(@bitmap,1,1) & 1 = 1
update BUYER set
BUYER = case substring(@bitmap,1,1) & 1 when 1 then @c1 else BUYER end
,BUYER_NAME = case substring(@bitmap,1,1) & 2 when 2 then @c2 else BUYER_NAME end
,PHONE = case substring(@bitmap,1,1) & 4 when 4 then @c3 else PHONE end
,COMP_CODE = case substring(@bitmap,1,1) & 8 when 8 then @c4 else COMP_CODE end
,ZUSER = case substring(@bitmap,1,1) & 16 when 16 then @c5 else ZUSER end
,COUNTRY = case substring(@bitmap,1,1) & 32 when 32 then @c6 else COUNTRY end
,REPLSVR = case substring(@bitmap,1,1) & 64 when 64 then @c7 else REPLSVR end
where BUYER = @pkc1
else
update BUYER set
BUYER = case substring(@bitmap,1,1) & 1 when 1 then @c1 else BUYER end
,BUYER_NAME = case substring(@bitmap,1,1) & 2 when 2 then @c2 else BUYER_NAME end
,PHONE = case substring(@bitmap,1,1) & 4 when 4 then @c3 else PHONE end
,COMP_CODE = case substring(@bitmap,1,1) & 8 when 8 then @c4 else COMP_CODE end
,ZUSER = case substring(@bitmap,1,1) & 16 when 16 then @c5 else ZUSER end
,COUNTRY = case substring(@bitmap,1,1) & 32 when 32 then @c6 else COUNTRY end
,REPLSVR = case substring(@bitmap,1,1) & 64 when 64 then @c7 else REPLSVR end
where BUYER = @pkc1
================================
通過比較字段是否被修改來在SERVER端對相應的資料表進行修改。
但無法將程序中的BINARY變量直接賦給存儲過程的參數@BITMAP上。
請教各位先進,有無解決辦法?
在DELHPI6中進行編譯時,
針對存儲過程parameters.ParamByName('@bitmap').value值是variant類型
而我的BINARY變量是BINARY類型。無法直接賦值。