我正在尝试在用Java调用的Sybase数据库中创建存储过程,并获取填充2个单独表的输入参数;一些参数进入两者,有些参数只进入其中一个表。
这是我的存储过程代码:
Create procedure dbo.ps_bau_insert (in userID varChar(8), in busReason varChar(800), in weekID Integer,
in qScript varChar(800), in success BIT, in rowsAffected varChar(100))
BEGIN
Insert into dbo.tbau_request_details
(weekID, userID, Date, qScript, BusReason, Success, Rows)
values (weekID, userID, getDate(), qScript, busReason, success, rowsAffected)
Insert into dbo.tbau_request_cm
(userID, Date, BusReason, Success, Rows)
values (userID, getDate(), busReason, success, rowsAffected);
End
我收到了错误:
Error report -
Incorrect syntax near the keyword 'BEGIN'.
据我所知(通过查看sybase文档),语法是正确的;错误陈述另有说法。有人可以帮我看看这里有什么不对吗?
谢谢!
答案 0 :(得分:4)
如果您使用的是Sybase ASE,则需要在BEGIN之前拥有AS。
语法
Transact-SQL CREATE PROCEDURE语句的这个子集是 Sybase IQ支持:
CREATE PROCEDURE [owner。] procedure_name
... [[(] @parameter_name data-type [= default] [OUTPUT] [,...] [)]]
... [WITH RECOMPILE]
... AS
... statement-list