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

First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.

0 Answers   Prodapt,


what is acid property in database? : Sql dba

0 Answers  


What sql database should I use?

0 Answers  


What is oracle sql called?

0 Answers  


How would you pass hints to the sql processor?

0 Answers  






What is TABLE SPACE?

4 Answers   ABB, TCS,


What is meaning of <> in sql?

0 Answers  


How do I enable sql encryption?

0 Answers  


What is an ndf file?

0 Answers  


difference between anonymous blocks and sub-programs.

0 Answers  


I have the table like this S.No Name ID 01 Xyz 123 I want the result as 01Xyz123 How to write the query to retrieve the entire row data in a single column?

1 Answers  


What is integrity in sql?

0 Answers  


Categories