PLS-00103: Encountered the symbol "@" when expecting one of the following:
756322Feb 25 2010 — edited Feb 25 2010Hi Friends,
I new Pl/SQL development , I am getting below compilation error when I am excuting the code as shown below. pls somebody guide me how can get ride of those erros.
Error report:
ORA-06550: line 1, column 9:
PLS-00103: Encountered the symbol "@" when expecting one of the following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor
The symbol "@" was ignored.
ORA-06550: line 2, column 1:
PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following:
:= ; not null default character
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
====================================================================
Code :
DECLARE @Dist_CD VARCHAR(50)
DECLARE @path VARCHAR(100)
DECLARE @filename VARCHAR(100)
StoreExportfile UTL_FILE.file_type;
set @path ='C:\Ortec\Store\Exportfiles'
set @filename = 'StoresExport'
DECLARE Dist_Cur CURSOR FOR
SELECT distinct DISTRICT_CD
FROM SBL.RETAIL_CUSTOMER
WHERE DISTRICT_CD is not null
OPEN Dist_Cur
FETCH NEXT FROM db_cursor INTO @Dist_CD
WHILE @@FETCH_STATUS = 0
BEGIN
StoreExportfile := UTL_FILE.fopen(@path,@filename||'_'||@Dist_CD||'.TXT','W');
SELECT
A.NAME,
P.ADDR,
P.ADDR_LINE_2,
P.CITY,
P.COUNTRY,
P.ZIPCODE
FROM
S_ORG_EXT A,
s_ADDR_PER P,
S_CON_ADDR S,
SBL.RETAIL_CUSTOMER RC
WHERE
A.ROW_ID = S.ACCNT_ID
AND S.ADDR_PER_ID = P.ROW_ID
AND A.OU_TYPE_CD IN ('Store','HQ')
-- AND A.LAST_UPD >= (Select SYSDATE-7 from dual)
AND RC.CUST_ROW_ID = A.ROW_ID
AND RC.DISTRICT_CD = @Dist_CD;
UTL_FILE.put_line(StoreExportfile, A.NAME,
P.ADDR,
P.ADDR_LINE_2,
P.CITY,
P.COUNTRY,
P.ZIPCODE);
UTL_FILE.fclose(StoreExportfile);
FETCH NEXT FROM db_cursor INTO @Dist_CD
END
Thanks,
Santhosh