how can i read write files from pl/sql

Answers were Sorted based on User's Feedback



how can i read write files from pl/sql..

Answer / deepak singh

throug the Text_io package

Is This Answer Correct ?    2 Yes 0 No

how can i read write files from pl/sql..

Answer / avi007

DECLARE
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN('/tmp', 'myfile', 'W');
UTL_FILE.PUTF(fileHandler, 'Look ma, I''m writing to a
file!!!\n');
UTL_FILE.FCLOSE(fileHandler);
EXCEPTION
WHEN utl_file.invalid_path THEN
raise_application_error(-20000, 'ERROR:
Invalid path
for file or path not in INIT.ORA.');
END;
/

Is This Answer Correct ?    2 Yes 0 No

how can i read write files from pl/sql..

Answer / avi007

--Read file

DECLARE
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN('/tmp', 'myfile', 'R');
UTL_FILE.GETF(fileHandler, 'Look ma, I''m writing to a
file!!!\n');
UTL_FILE.FCLOSE(fileHandler);
EXCEPTION
WHEN utl_file.invalid_path THEN
raise_application_error(-20000, 'ERROR:
Invalid path
for file or path not in INIT.ORA.');
END;
/

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

Can we create foreign key without primary key?

0 Answers  


What are the topics in pl sql?

0 Answers  


what happens if null values are involved in expressions? : Sql dba

0 Answers  


Can I learn sql in a week?

0 Answers  


What is data types in sql?

0 Answers  






How to use sql statements in pl/sql?

0 Answers  


What is a package ? What are the advantages of packages ?

2 Answers   Symphony,


Can we use distinct and group by together?

0 Answers  


What is ttitle and btitle?

0 Answers  


What is a table in a database?

0 Answers  


What are the difference between Functions/Stored Procs and Triggers and where are they used.

1 Answers   CGI, TCS,


how to write date and time literals? : Sql dba

0 Answers  


Categories