Home » SQL & PL/SQL » SQL & PL/SQL » Error occured while compiling
icon4.gif  Error occured while compiling [message #238251] Thu, 17 May 2007 03:39 Go to next message
kogilaah_k
Messages: 20
Registered: May 2007
Location: Malaysia
Junior Member
I HAVE BEEN TRYING TO SOLVE THE ERRORS THAT KEEPS ON COMING EACH TIME I COMPILE. PLEASE HELP ME SOLVE IT. I AM NEW IN PLSQL AND THIS IS MY FIRST TASK. WOULD APPRECIATE IF THERE IS ANYONE OUR THE TO HELP ME.......

THIS ARE THE LIST OF ERRORS THAT OCCURED.
346/3 PLS-00103: Encountered the symbol "ELSE" when expecting one of
the following:
begin case declare end exit for goto if loop mod null
pragma raise return select update while with
<an identifier>
<a double-quoted delimited-identifier>
<a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge pipe

356/7 PLS-00103: Encountered the symbol "LINE_CNT"
356/31 PLS-00103: Encountered the symbol ";" when expecting
one of the following:
) , * & = - + < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like
LIKE2_ LIKE4_ LIKEC_ between || member SUBMULTISET_


366/7 PLS-00103: Encountered the symbol "IF" when expecting
one of the following:
end not pragma final instantiable order overriding
static member constructor map

387/3 PLS-00103: Encountered the symbol "BEGIN" when
expecting one of the following:

541/5 PLS-00103: Encountered the symbol "end-of-file" when
expecting one of the following:
end not pragma final instantiable order overriding
static member constructor map

-----------------------
C1,C2,C3,C4....

----------------------

TYPE REC_VEND_NO_TYPE IS TABLE OF PO_VENDORS.VEND_NO%TYPE
INDEX BY BINARY_INTEGER;
REC_VEND_NO REC_VEND_NO_TYPE;

TYPE REC_VENDOR_NAME_TYPE IS TABLE OF PO_VENDORS.VENDOR_NAME%TYPE
INDEX BY BINARY_INTEGER;
REC_VENDOR_NAME REC_VENDOR_NAME_TYPE;

TYPE REC_ITEM_NO_TYPE IS TABLE OF MTL_SYSTEM_ITEMS_B.SEGMENT1%TYPE
INDEX BY BINARY_INTEGER;
REC_ITEM_NO REC_ITEM_NO_TYPE;

TYPE REC_DESC_TYPE IS TABLE OF MTL_SYSTEM_ITEMS_B.DESCRIPTION%TYPE
INDEX BY BINARY_INTEGER;
REC_DESC REC_DESC_TYPE;

TYPE REC_CATEGORY_TYPE IS TABLE OF B.CATEGORY%TYPE
INDEX BY BINARY_INTEGER;
REC_CATEGORY REC_CATEGORY_TYPE;

TYPE REC_COUNT_TYPE IS TABLE OF NUMBER
INDEX BY BINARY_INTEGER;
REC_COUNT REC_COUNT_TYPE;



V_ORG_NAME ORG_ORGANIZATION_DEFINITIONS.ORGANIZATION_NAME%TYPE;
V_VEND_NO PO_VENDORS.VEND_NO%TYPE;
V_VENDOR_NAME PO_VENDORS.VENDOR_NAME%TYPE;
V_ITEM_NO MTL_SYSTEM_ITEMS_B.SEGMENT1%TYPE;
V_DESC MTL_SYSTEM_ITEMS_B.DESCRIPTION%TYPE;
V_CATEGORY B.CATEGORY%TYPE;
V_COUNT NUMBER;


MAX_LINE BINARY_INTEGER DEFAULT 0;
PAGE_LINE CONSTANT NUMBER := 45;
1 BINARY_INTEGER DEFAULT 0;

STS NUMBER DEFAULT 0;
CNC_RET BOOLEAN;
STS_ERROR EXCEPTION;
ERR_RET VARCHAR2 (240);
OK_RET VARCHAR2 (240);
V_MSG VARCHAR2 (241);
V_ERR_MSG VARCHAR2 (1000);


/*==========================================================
PRINT_HEADER
==========================================================*/

PROCEDURE PRINT_HEADER (PAGE_CNT IN NUMBER) IS

BEGIN


FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(V_ORG_NAME,23) || RPAD(' ',102) || 'Report Date : ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI'));
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'Report ID : TMIN0870' || RPAD(' ',81) || 'Page : ' || RPAD(TO_CHAR(PAGE_CNT),4));

FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' ');

FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(' ',50) || 'TIM DTS Receiving Lot by Vendor');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' ');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,LPAD('Ln',6) ||' '||RPAD('Vendor No',12)||' '||RPAD('Vendor Name',42)||' '||RPAD('Item No',12)||' '||RPAD('Description',60)||' '||RPAD('Category',8)||' '||RPAD('Rec Lot',4));

FND_FILE.PUT_LINE(FND_FILE.OUTPUT, '------------ ------------------------------------------ ------------ ------------------------------------------------------------ -------- ----');
END PRINT_HEADER;


/*==============================================
DISPLAY_REPORT
=============================================*/

FUNCTION DISPLAY_REPORT(
P_MAX_LINE IN NUMBER,
P_ERR_MSG OUT VARCHAR2
) RETURN NUMBER IS

LINE_CNT NUMBER DEFAULT 0;
PAGE_CNT NUMBER DEFAULT 0;
V_OLD_VEND_NO PO_VENDORS.VEND_NO%TYPE := '*********';

BEGIN
FOR IDX IN 0..P_MAX_LINE LOOP
IF LINE_CNT = 0 THEN
PAGE_CNT := PAGE_CNT + 1;
PRINT_HEADER(PAGE_CNT);
LINE_CNT := 0;
END IF;


FND_FILE.PUT_LINE(FND_FILE.OUTPUT,LPAD(TO_CHAR(IDX+1),6) ||' '||
RPAD(REC_VEND_NO(IDX),12)||' '|| RPAD(REC_VENDOR_NAME(IDX),42)
||' '||RPAD(REC_ITEM_NO(IDX),12)||' '||RPAD(REC_DESC(IDX),60)
||' '||RPAD(REC_CATEGORY(IDX),8)||' '||RPAD(TO_CHAR(REC_REC_TYPE(IDX), ' '),4));

ELSE

FND_FILE.PUT_LINE(FND_FILE.OUTPUT,LPAD(TO_CHAR(IDX+1),6) ||' '||
RPAD(REC_VEND_NO(IDX),12)||' '|| RPAD(REC_VENDOR_NAME(IDX),42)
||' '||RPAD(REC_ITEM_NO(IDX),12)||' '||RPAD(REC_DESC(IDX),60)
||' '||RPAD(REC_CATEGORY(IDX),8)||' '||RPAD(TO_CHAR(REC_REC_TYPE(IDX), ' '),4));


END IF;

LINE_CNT := LINE_CNT + 1;
V_OLD_VEND_NO := REC_VEND_NO(IDX);

IF LINE_CNT >= PAGE_LINE THEN
LINE_CNT := 0;
FND_FILE.PUT(FND_FILE.OUTPUT,CHR(12));
END IF;

END LOOP;

IF LINE_CNT >= PAGE_LINE THEN
LINE_CNT := 0;
FND_FILE.PUT(FND_FILE.OUTPUT,CHR(12));
PAGE_CNT := PAGE_CNT + 1;
PRINT_HEADER(PAGE_CNT);
END IF;

FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' ');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(' ',60) ||
'********** END OF REPORT **********');

RETURN OK_RET;

END DISPLAY_REPORT;



/*=================================================
MAIN
=================================================*/

BEGIN

--FND_FILE.PUT_NAMES('/tmp/odev/TMIN0870-debug.log','/tmp/odev/TMIN0870-debug.out','/tmp/ofsh');

SELECT ORGANIZATION_NAME
INTO V_ORG_NAME
FROM ORG_ORGANIZATION_DEFINITIONS
WHERE ORGANIZATION_ID = 21;


IF PRA_VEND_NO IS NULL AND PRA_ITEM_ID IS NULL THEN
V_MSG := 'OPEN CO1';
OPEN CO1;
V_MSG := 'FETCH CO1';
LOOP
FETCH CO1 INTO
V_VEND_NO,
V_VENDOR_NAME,
V_ITEM_NO,
V_DESC,
V_CATEGORY,
V_COUNT;
EXIT WHEN CO1%NOTFOUND;
REC_VEND_NO(1) := V_VEND_NO;
REC_VENDOR_NAME(1) := V_VENDOR_NAME;
REC_ITEM_NO(1) := V_ITEM_NO;
REC_DESCRIPTION := V_DESCRIPTION;
REC_CATEGORY := V_CATEGORY;
REC_COUNT := V_COUNT;



END LOOP;
V_MSG := 'CLOSE CO1';
CLOSE CO1;

ELSIF

PRA_VEND_NO IS NOT NULL AND PRA_ITEM_STATUS IS NULL THEN
V_MSG := 'OPEN C02';
OPEN C02;
V_MSG := 'FETCH C02';
LOOP
FETCH C02 INTO
V_VENDOR_NO,
V_VENDOR_NAME,
V_ITEM_NO,
V_DESC,
V_CATEGORY,
V_COUNT;
EXIT WHEN C02%NOTFOUND;

END LOOP;
V_MSG := 'CLOSE C02';
CLOSE C02;


ELSIF

PRA_VEND_NO IS NULL AND PRA_ITEM_STATUS IS NOT NULL THEN
V_MSG := 'OPEN C03';
OPEN C03;
V_MSG := 'FETCH C03';
LOOP
FETCH C03 INTO
V_VENDOR_NO,
V_VENDOR_NAME,
V_ITEM_NO,
V_DESC,
V_CATEGORY,
V_COUNT;
EXIT WHEN C03%NOTFOUND;

END LOOP;
V_MSG := 'CLOSE C03';
CLOSE C03;


ELSIF


PRA_VEND_NO IS NOT NULL AND PRA_ITEM_STATUS IS NOT NULL THEN
V_MSG := 'OPEN C04';
OPEN C04;
V_MSG := 'FETCH C04';
LOOP
FETCH C04 INTO
V_VENDOR_NO,
V_VENDOR_NAME,
V_ITEM_NO,
V_DESC,
V_CATEGORY,
V_COUNT;
EXIT WHEN C04%NOTFOUND;

END LOOP;
V_MSG := 'CLOSE C04';
CLOSE C04;

END IF;

MAX_LINE := l - 1;

FND_FILE.PUT_LINE(FND_FILE.LOG,' MAX_LINE: '||MAX_LINE);

STS := DISPLAY_REPORT(MAX_LINE,V_MSG);
IF STS = ERR_RET THEN RAISE STS_ERROR;

END IF;

CNC_RET := FND_CONCURRENT.SET_COMPLETION_STATUS ('NORMAL',NULL);

EXCEPTION
WHEN STS_ERROR THEN
IF CO1%ISOPEN THEN CLOSE CO1;
END IF;
IF CO2%ISOPEN THEN CLOSE CO2;
END IF;
IF CO3%ISOPEN THEN CLOSE CO3;
END IF;
IF CO4%ISOPEN THEN CLOSE C04;
END IF;

FND_FILE.PUT_LINE(FND_FILE.LOG,'STS_ERROR : '||V_MSG);
IF SQLCODE != 0 THEN
FND_FILE.PUT_LINE(FND_FILE.LOG,'SQLCODE : '||TO_CHAR(SQLCODE));
FND_FILE.PUT_LINE(FND_FILE.LOG,'SQLERRM : '||SQLERRM);

END IF;

FND_FILE.PUT_LINE(FND_FILE.LOG,'---------------------------');
FND_FILE.PUT_LINE(FND_FILE.LOG,'ERROR-2');
CNC_RET := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',NULL);

WHEN OTHERS THEN
IF C01%ISOPEN THEN CLOSE C01;
END IF;
IF C02%ISOPEN THEN CLOSE C02;
END IF;
IF CO3%ISOPEN THEN CLOSE CO3;
END IF;
IF CO4%ISOPEN THEN CLOSE CO4;
END IF;

FND_FILE.PUT_LINE(FND_FILE.LOG,'ERROR-1 :'||V_MSG);
IF SQLCODE != 0 THEN
FND_FILE.PUT_LINE(FND_FILE.LOG,'SQLCODE : '||TO_CHAR(SQLCODE));
FND_FILE.PUT_LINE(FND_FILE.LOG,'SQLERRM : '||SQLERRM);
END IF;

FND_FILE.PUT_LINE(FND_FILE.LOG,'---------------------------');
FND_FILE.PUT_LINE(FND_FILE.LOG,'ERROR-2');
CNC_RET := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',NULL);

END;
/
show error
Re: Error occured while compiling [message #238253 is a reply to message #238251] Thu, 17 May 2007 03:54 Go to previous messageGo to next message
Michel Cadot
Messages: 64117
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
How to format your posts with line numbers.
Do you think we count your lines?

Regards
Michel
Re: Error occured while compiling [message #238360 is a reply to message #238253] Thu, 17 May 2007 10:30 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
and post your complete code.
You seem to have missed the header of the package body.
Previous Topic: how to use an cursor for loop
Next Topic: Executing a trigger
Goto Forum:
  


Current Time: Tue Dec 06 04:46:17 CST 2016

Total time taken to generate the page: 0.12474 seconds