In my pl/sql sprocedure, trying store cursor data into into a test file on our windows network drive. It compiles but when I run it, getting error: ORA-00972: identifier is too long
create or replace
procedure openDataTest
is
fHandle UTL_FILE.FILE_TYPE;
CURSOR cur IS
select a.key_location from XXX.YYYY a;
rec cur%ROWTYPE;
begin
fHandle := UTL_FILE.FOPEN('windows network drive', 'test_file', 'w');
OPEN cur;
LOOP
FETCH cur INTO rec;
EXIT WHEN cur%NOTFOUND;
UTL_FILE.PUT(fHandle, rec.key_location);
END LOOP;
CLOSE cur;
UTL_FILE.FCLOSE(fHandle);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Exception: SQLCODE=' || SQLCODE || ' SQLERRM=' || SQLERRM);
RAISE;
end;
It compiles but when I run it, getting error:
Connecting to the database XXX dev.
ORA-00972: identifier is too long
ORA-06512: at "XXX.YYYY", line 21
ORA-06512: at "SYS.UTL_FILE", line 41
ORA-06512: at "SYS.UTL_FILE", line 478
ORA-06512: at "XXX.YYYY", line 8
ORA-06512: at line 2
Exception: SQLCODE=-972 SQLERRM=ORA-00972: identifier is too long
Process exited.
I tried to write file into other network drive with shorter path but still has same error.