db2 存储过程SQLCODE=-104, SQLSTATE=42601, SQLERRMC=USE;BEGIN-OF-STATEMENT;

liuganglovehxl 2014-11-15 01:25:12
USE [DB2ADMIN].[minmetals_hr01]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [DB2ADMIN].[GetApply_jobsForApply_ids](
@group_no int
)
AS

declare @mytemp varchar(2000)
declare @pos int
declare @oldPos int
declare @tempstr varchar(2000)

create table #temp_id
(
id int
)

select @mytemp=apply_ids from job_lev where lev_type = 1 and group_no= @group_no

set @pos=1
set @oldPos=1
while @pos<len(@mytemp)
begin
set @pos=charindex(',',@mytemp,@oldpos)
if @pos>0
begin
set @tempstr=substring(@mytemp,@oldpos,@pos-@oldpos)
set @oldpos=@pos+1
end
else
begin
set @tempstr=substring(@mytemp,@oldpos,len(@mytemp)-@oldpos+1)
set @pos=len(@mytemp)
end
insert into #temp_id
select @tempstr
end

select job_no,apply_id,job,department,annual,period,job_state,job_end from apply_jobs where apply_id in (select id from #temp_id) order by job_end desc, annual desc, period desc,job_no

drop table #temp_id

报DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=USE;BEGIN-OF-STATEMENT;<variable_set>, DRIVER=4.15.82 望大神指教!!!
...全文
5363 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,889

社区成员

发帖
与我相关
我的任务
社区描述
IBM DB2 是美国IBM公司开发的一套关系型数据库管理系统,它主要的运行环境为UNIX(包括IBM自家的AIX)、Linux、IBM i(旧称OS/400)、z/OS,以及Windows服务器版本
社区管理员
  • DB2
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧