Q
qinjjun
Unregistered / Unconfirmed
GUEST, unregistred user!
CREATE PROCEDURE SP_XXX
(@code [char](30),
@id [char](10)
@error_code [int] output)
AS
if @error_code=0
INSERT INTO [XXX]
( code,
id)
VALUES
( @code,
@id)
if (@@error<>0)
begin
UPDATE [XXX]
SET
(@code [char](30),
@id [char](10)
@error_code [int] output)
AS
if @error_code=0
INSERT INTO [XXX]
( code,
id)
VALUES
( @code,
@id)
if (@@error<>0)
begin
UPDATE [XXX]
SET
代码:
= @code,
[id]=@id
WHERE
( [code] = @code)
end
select @error_code= @@error
GO
执行环境(sql2000,delphi 5)
有重复记录时,delphi会捕捉到异常
如何写这个过程才能屏蔽异常?