how can i read files from a pl/sq l program

Answers were Sorted based on User's Feedback



how can i read files from a pl/sq l program..

Answer / mahesh

by using utl_file (built-in package)

Is This Answer Correct ?    5 Yes 0 No

how can i read files from a pl/sq l program..

Answer / guru

__________________________________________________________
DECLARE
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN('/tmp', 'myfile', 'R');
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;
/
________________________________________________________



Thanks

Is This Answer Correct ?    3 Yes 0 No

how can i read files from a pl/sq l program..

Answer / swayamji

SELECT TEXT FROM USER_SOURCE WHERE NAME LIKE '<SUB PROGRAM
NAME>'

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

What is the requirement of self-join?

0 Answers  


What is the maximum rows in csv?

0 Answers  


Why we use join in sql?

0 Answers  


What is not in sql?

0 Answers  


what is index? : Sql dba

0 Answers  






Practice 1: Changes to data will only be allowed on tables during normal office hours of 8.45 in the morning until 5.30 in the afternoon, MONDAY through FRIDAY. A. Create a procedure called SECURE_DML that prevents the DML statement from executing outside of normal office hours, returning the message: “you may only make changes during normal office hours” b. Create a statement trigger on the PRODUCT table which calls the above procedure. c. Test it by inserting a new record in the PRODUCT table.

1 Answers   Tech Mahindra,


Why we use sql profiler?

0 Answers  


What is the usage of when clause in trigger?

0 Answers  


How do you optimize a stored procedure query?

0 Answers  


what is explain plan?, given an example...

3 Answers   Polaris,


What is the difference between cross join and natural join?

0 Answers  


How do you clear the screen in sql?

0 Answers  


Categories