Sql 过程失败,出现错误';SybaseErrorProcess';

Sql 过程失败,出现错误';SybaseErrorProcess';,sql,sybase,Sql,Sybase,每当我运行以下过程时,我都会收到SybaseErrorProcess: CREATE PROC stdCont(@Cpty_Id INTEGER, @TradeDate DATETIME) AS BEGIN CREATE TABLE Ktest..FwdCont (Txn_No NUMERIC(10) IDENTITY, Deals_Id INTEGER NULL, Amount FLOAT NULL,OptionDate DATETIME NULL) insert

每当我运行以下过程时,我都会收到
SybaseErrorProcess

CREATE PROC stdCont(@Cpty_Id INTEGER,  @TradeDate DATETIME) AS
BEGIN
    CREATE TABLE Ktest..FwdCont
    (Txn_No NUMERIC(10) IDENTITY, Deals_Id INTEGER NULL, Amount FLOAT NULL,OptionDate DATETIME NULL)

    insert into Ktest..FwdCont (Deals_Id ,Amount  ) (select Deals_Ids,amt from Ktest..trans)
    Update Ktest..FwdCont Set OptionDate = @TradeDate Where Deals_Id = @Cpty_Id

    select bk.tnxno,bk.bk.dealid ,fd.OptionDate ,fd.Amount    from Ktest..bakwnd bk ,Ktest..FwdCont fd where bk.dealid=fd.Deals_Id  and bk.op_date=fd.OptionDate

    DROP TABLE Ktest..FwdCont 
end 
错误日志如下所示

number(2714) severity(16) state(1) line(9)
Connection Id:920 [raj@PROD-plus]
Server PLUS_ser
Procedure stdCont
Message string There is already an object named 'FwdCont' in the database.


*** Error(Fri 26 Jul 2013 - 18:21:54): SybaseErrorProcess

BEGIN SQL-REQUEST:
Ktest..stdCont 71495,  "07/25/2013"
END SQL-REQUEST


*** Error(Fri 26 Jul 2013 - 18:21:54):
Cannot perform your action:
Server Message:
         number(12336) severity(16) state(1) line(40)
        Connection Id:920 [raj@PROD-plus]
Server PLUS_ser
Procedure stdCont
Message string Definition time object 'database 'Ktest' (5), object 'FwdCont' (1974935499)' found at run time as an attempt to drop the table had failed i
n a previous query. Please drop the above mentioned table using the DROP TABLE c
ommand.

*** Error(Fri 26 Jul 2013 - 18:21:54): SybaseErrorProcess

BEGIN SQL-REQUEST:
Ktest..stdCont 71495,  "07/25/2013"
END SQL-REQUEST

*** Error(Fri 26 Jul 2013 - 18:21:54):
Cannot perform your action:
Server Message:
         number(12336) severity(16) state(1) line(40)
        Connection Id:920 [raj@PROD-plus]
Server PLUS_ser
Procedure stdCont
Message string Definition time object 'database 'Ktest' (5), object 'FwdCont' (1974935499)' found at run time as an attempt to drop the table had failed i
n a previous query. Please drop the above mentioned table using the DROP TABLE c
ommand.


*** Error(Fri 26 Jul 2013 - 18:21:54): SybaseErrorProcess

BEGIN SQL-REQUEST:
Ktest..stdCont 71495,  "07/25/2013"
END SQL-REQUEST

*** Error(Fri 26 Jul 2013 - 18:21:54):
Cannot perform your action:
Server Message:
         number(12336) severity(16) state(1) line(40)
        Connection Id:920 [raj@PROD-plus]
Server PLUS_ser
Procedure stdCont
Message string Definition time object 'database 'Ktest' (5), object 'FwdCont' (1974935499)' found at run time as an attempt to drop the table had failed i
n a previous query. Please drop the above mentioned table using the DROP TABLE c
ommand.

*** Error(Fri 26 Jul 2013 - 18:21:54): SybaseErrorProcess

BEGIN SQL-REQUEST:
Ktest..stdCont 71495,  "07/25/2013"
END SQL-REQUEST


*** Error(Fri 26 Jul 2013 - 18:21:54):
Cannot perform your action:
Server Message:
         number(12336) severity(16) state(1) line(40)
        Connection Id:920 [raj@PROD-plus]
Server PLUS_ser
Procedure stdCont
Message string Definition time object 'database 'Ktest' (5), object 'FwdCont' (1974935499)' found at run time as an attempt to drop the table had failed i
n a previous query. Please drop the above mentioned table using the DROP TABLE c
ommand.

*** Error(Fri 26 Jul 2013 - 18:21:54):
Cannot perform your action:
Server Message:
         number(11060) severity(16) state(1) line(40)
        Connection Id:920 [raj@PROD-plus]
Server PLUS_ser
Procedure stdCont
Message string This statement has exceeded the maximum number of recompilations
(10). This indicates an internal error. Please note the error prior to this one
and contact Sybase Technical Support.
可能是死锁?

信息很清楚


您的数据库中已经有了
FwdCont
表,这可能是因为存储过程的一个旧执行过程。

Thand for reply,但在过程结束时,我会删除FwdCont表。那么为什么显示错误可能是最后一次运行没有成功执行,最好在创建表之前添加一个检查表是否存在。如何避免此问题。。如果有任何一个解决方案,请通知我您使用的是什么数据库?Sybase,我找到了解决方案。我们创建#表,即临时表而不是物理表。它不会抛出错误。