아래 프로시저를 오라클로 변환 할려고 하는데요.. 도움 바랍니다.
--프로시저 GetReplyArticleStep CREATE PROC GetReplyArticleStep @b_id varchar(12), @c_id int, @c_step int, @c_depth int AS DECLARE @step1 int DECLARE @step2 int DECLARE @result int
SET @result =@c_step SET @step1 =(SELECT MIN(c_step) FROM boardlist WHERE b_id = @b_id AND c_id = @c_id AND c_step > @c_step AND c_depth <= @c_depth) IF @step1 IS NOT NULL BEGIN SET @step2 = (SELECT MAX(c_step) FROM boardlist WHERE b_id = @b_id AND c_id =@c_id AND c_step > @c_step AND c_step < @step1 AND c_depth > @c_depth) IF @step2 IS NOT NULL SET @result = @step2 END ELSE BEGIN SET @step2 = (SELECT MAX(c_step) FROM boardlist WHERE b_id = @b_id AND c_id = @c_id AND c_step > @c_step AND c_depth > @c_depth) IF @step2 IS NOT NULL SET @result =@step2 END SELECT @result +1 GO 좋은 하루되세요..^--^... |