【问题标题】:Procedure fails with error 'SybaseErrorProcess'过程失败并出现错误“SybaseErrorProcess”
【发布时间】:2015-06-08 16:36:42
【问题描述】:

每当我运行以下程序时,我都会收到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.

也许是死锁?

【问题讨论】:

    标签: sql sybase


    【解决方案1】:

    信息很清楚!

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

    【讨论】:

    • 感谢回复,但程序结束时我删除了 FwdCont 表。那为什么显示错误
    • 可能是上次运行没有成功,最好在创建表之前添加一个检查表是否存在。
    • 如何避免这个问题。如果有任何一种解决方案请。告诉我
    • 你用的是什么数据库?
    • Sybase,我找到了解决方案。我们创建#table,即临时表而不是物理表。它不会引发错误。
    猜你喜欢
    • 1970-01-01
    • 2021-11-09
    • 2018-02-24
    • 2012-09-24
    • 2017-04-12
    • 2013-07-18
    • 2021-10-12
    • 2020-10-23
    • 2020-07-20
    相关资源
    最近更新 更多