db2 存储过程SQLCODE=-104, SQLSTATE=42601, SQLERRMC=USE;BEGIN-OF-STATEMENT;
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 望大神指教!!!