UTL_FILE [message #275770] |
Mon, 22 October 2007 11:11 |
|
Hi All,
This is my first post. I will be glad if you can help me.
I am getting the error:
ORA-06550: line 2, column 12:
PLS-00201: identifier 'UTL_FILE' must be declared
ORA-06550: line 2, column 12:
PL/SQL: Item ignored
ORA-06550: line 5, column 3:
PLS-00320: the declaration of the type of this expression is incomplete or malformed
ORA-06550: line 5, column 3:
PL/SQL: Statement ignored
-------
here are what i have done:
(1) OS: mkdir C:\ORALOAD
(2) CREATE DIRECTORY oraload AS 'C:\ORALOAD\';
(3) and lastly the PL/SQL
DECLARE
vInHandle utl_file.file_type;
vNewLine VARCHAR2(250);
BEGIN
vInHandle := utl_file.fopen('ORALOAD', 'test.txt', 'R');
LOOP
BEGIN
utl_file.get_line(vInHandle, vNewLine);
dbms_output.put_line(vNewLine);
EXCEPTION
WHEN OTHERS THEN
EXIT;
END;
END LOOP;
utl_file.fclose(vInHandle);
END fopen;
/
|
|
|
|
Re: UTL_FILE [message #275772 is a reply to message #275770] |
Mon, 22 October 2007 11:16 |
|
Thanks, thats a good observation. But how can I pass thru the UTL_FILE error? It will still no work just the same right? please help.
|
|
|
|
|
|
|
|
Re: UTL_FILE [message #275977 is a reply to message #275770] |
Tue, 23 October 2007 09:45 |
|
hello all, thanks for your replies but I am just working locally,
this is our assignment and I am getting trouble working it on
|
|
|
Re: UTL_FILE [message #275996 is a reply to message #275770] |
Tue, 23 October 2007 10:42 |
|
I have already created a procedure, and tried to run the script above, but I am still getting the same error
CREATE OR REPLACE procedure UTL_FUNCTION (test VARCHAR2) IS
vInHandle utl_file.file_type;
vNewLine VARCHAR2(200);
BEGIN
vInHandle := utl_file.fopen('C:\ORALOAD\', 'test.txt','r');
IF utl_file.is_open(vInHandle ) THEN
LOOP
BEGIN
utl_file.get_line(vInHandle , vNewLine);
IF vNewLine IS NULL THEN
EXIT;
END IF;
END;
END LOOP;
END;
.
|
|
|
|
Re: UTL_FILE [message #276010 is a reply to message #275770] |
Tue, 23 October 2007 11:57 |
|
FORGIVE ME with my ignorance, I dont know what's catproc.sql, what it does with Oracle.
Thanks for sharing your valuable time. I really appreciate it
.
|
|
|
|
Re: UTL_FILE [message #276097 is a reply to message #276010] |
Tue, 23 October 2007 23:33 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
sbenosa wrote on Tue, 23 October 2007 18:57 |
FORGIVE ME with my ignorance, I dont know what's catproc.sql, what it does with Oracle.
Thanks for sharing your valuable time. I really appreciate it
.
|
20.500 hits for catproc.sql on Google. Or don't you know what that is either?
|
|
|
|
|
|
Re: UTL_FILE [message #276286 is a reply to message #275770] |
Wed, 24 October 2007 12:07 |
|
Hi All,
I was able to run the catproc.sql sctipt.
@$ORACLE_HOME/rdbms/admin/catproc
However, I am getting another error, but i will try to solve it my own first. I will not hesitate though to post it should I run into trouble.
I really appreciate your help. One information will lead to another information to research. It makes my oracle training more interesting. Thanks and Godbless
|
|
|
Re: UTL_FILE [message #276594 is a reply to message #275770] |
Thu, 25 October 2007 10:23 |
|
Hi All, this is the latest error I am getting. I tried to manipulate the data declarations but i am still getting the same. Thanks
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at line 5
|
|
|
|
Re: UTL_FILE [message #276612 is a reply to message #275770] |
Thu, 25 October 2007 11:03 |
|
When I run my initial query
DECLARE
vInHandle utl_file.file_type;
vNewLine VARCHAR2(250);
BEGIN
vInHandle := utl_file.fopen('ORALOAD', 'test.txt', 'R');
LOOP
BEGIN
utl_file.get_line(vInHandle, vNewLine);
dbms_output.put_line(vNewLine);
--EXCEPTION
--WHEN OTHERS THEN
--EXIT;
END;
END LOOP;
utl_file.fclose(vInHandle);
END fopen;
/
|
|
|
Re: UTL_FILE [message #276692 is a reply to message #276612] |
Fri, 26 October 2007 00:35 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
You have no stop condition in your loop, so it is bound to exit only when an exception occurs.
I don't know what error utl_file raises when you try to read beyond the end of the file, but this could very well be the one.
|
|
|
|
Re: UTL_FILE [message #276705 is a reply to message #276612] |
Fri, 26 October 2007 01:01 |
|
Michel Cadot
Messages: 68716 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Which one is line 5?
Use SQL*Plus and copy and paste the execution then we can what you call and what SQL*Plus returns along with the line numbers.
Regards
Michel
|
|
|