How do you get nicely formatted results from an oracle procedure that returns a reference cursor?
Answer / Prabhat Yadav
To get nicely formatted results from an Oracle procedure that returns a REF CURSOR, you can use the DBMS_OUTPUT package to display the data.nn```sqln-- Prepare the procedurendbms_output.enable(10000);nCREATE OR REPLACE PROCEDURE get_data ISn cur_data SYS_REFCURSOR;nBEGINn OPEN cur_data FOR SELECT * FROM your_table;n DBMS_OUTPUT.PUT_LINE('Data:');n FOR rec IN cur_data LOOPn DBMS_OUTPUT.PUT_LINE(rec.column1 || ',' || rec.column2);n END LOOP;n CLOSE cur_data;nEND get_data;n-- Call the procedurendbms_output.put_line('Result:');nEXECUTE get_data;n``
| Is This Answer Correct ? | 0 Yes | 0 No |
How to save query output to a local file?
What is the data pump import utility?
t1 col1 col2 nishi 5000 lucky 6700 akash 7000 i want that a query that when i insert 7000 it will show me data already present and data will not insert. if data is not present it will insert.
How to write text literals in oracle?
What is the difference between alert log file and tarce file ?
How do you find out from the RMAN catalog if a particular archive log has been backed-up?
find out the second highest salary?
55 Answers Cognizant, Nucsoft, Oracle, TCS, Wondersoft,
How view is different from a table?
how to make an oracle object
What is an external table?
List the various oracle database objects?
What is logical backup in oracle?