[ 1883270 ] Enhance Document No Formatting

This commit is contained in:
Heng Sin Low 2008-02-02 05:03:52 +00:00
parent bd7a0c321d
commit b8443b2f9f
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
CREATE or REPLACE PROCEDURE NextIDByYear
(
p_AD_Sequence_ID IN NUMBER,
p_IncrementNo IN NUMBER,
p_CalendarYear IN CHAR,
o_NextID OUT NUMBER
)
AS
BEGIN
SELECT CurrentNext
INTO o_NextID
FROM AD_Sequence_No
WHERE AD_Sequence_ID=p_AD_Sequence_ID
AND CalendarYear = p_CalendarYear
FOR UPDATE OF CurrentNext;
--
UPDATE AD_Sequence_No
SET CurrentNext = CurrentNext + p_IncrementNo
WHERE AD_Sequence_ID=p_AD_Sequence_ID
AND CalendarYear = p_CalendarYear;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END NextIDByYear;
/