I am pretty new to Oracle and SQL and am running a query on a oracle database. What I need though, is to get a output from the query in horizontal columns instead of vertical columns. I need to get the output one line after another instead of in columns. I want to see every record with a break in between and the data in the following format.
Currently, I am getting something like this:
First Name | Last Name | Initial | Address 1 | Address 2 | City | State | Country
Thanks a lot to both of you for your help. These solutions do exactly what I need to do. Now, I have run into another problem though. There is a field in the database that I am querying which is listed as "CLOB" in the oracle database. It contains a copy of the e-mail or phone conversation that was recorded in the database. How do I get that displayed in the same query ? When I query that field in the queries mentioned above, I get error that says "Inconsistent Data type"
insert into proba values (1,'first clob');
insert into proba values (2,'second clob');
insert into proba values (1,'third clob');
set serveroutput on;
for i in (select a,b from proba)
You can try it.
This work if you have characters in the CLOB field, but if you have phone conversation it doesn’t work. You should be use BLOB or BFILE for phone conversation and dbms_lob package for reading and writing.