|
-
Originally posted by suhasd75
Hi,
First check whether UTL_FILE_DIR parameter is set or not.
sql>show parameter utl_file_dir
or
sql>select * from v$parameter where name='utl_file_dir';
If you dont get a value, then it is not set.
If a value for UTL_FILE_DIR is not set, then you cannot use the UTL_FILE package.
And Last, but not the least: READ THE DOCUMENTATION !!
Regards,
Suhas
"Shoot for the moon, even if u miss, u'll land among the stars !!"
You don't need to set this parm in 92, maybe you should read the documentation dude.
Here's a simple example that you should be able to build on to create your own proc
CREATE DIRECTORY test_dir AS 'c:\temp';
CREATE OR REPLACE PROCEDURE test
AS
v_output_file1 utl_file.file_type;
BEGIN
/* Ensure TEST_DIR below is in all caps */
/* Third argument below is W which overwrites file each time, change to A to append */
v_output_file1 := utl_file.fopen('TEST_DIR', 'my_test.csv', 'W');
FOR cursor_emp IN (SELECT empnom,ename, deptno FROM emp)
LOOP
utl_file.put_line(v_output_file1, cursor_emp.empno || ',' || cursor_emp.ename || ',' || cursor_emp.deptno);
END LOOP;
utl_file.fclose_all;
END;
/
I'm stmontgo and I approve of this message
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|