Link to home
Start Free TrialLog in
Avatar of rutgermons
rutgermons

asked on

oracle, 10, database, using carriage return

folks,how can i use oracle to define a carriage return of a date field

my field is reportdate  13-06-2008 14:25:02 and i want the field to display

reportdate
13-06-2008
14:25:02

im hesitant of it working but all help will do

r
Avatar of Milleniumaire
Milleniumaire
Flag of United Kingdom of Great Britain and Northern Ireland image

It depends which tool you are using to display the output.

The following characters will display a newline on a unix system:

chr(13)||chr(10)

For example:

declare
  newline varchar2(2) := chr(13)||chr(10);
begin
  dbms_output.put_line('Line1'||newline||'Line2');
end;
/
Avatar of schwertner
CHR(10) is enough!
Avatar of rutgermons
rutgermons

ASKER

example?
Dug the example out of some code.  Not sure why they use chr 13 and 10, but chr 10 is enough to give a newline as follows:
declare
  newline varchar2(1) := chr(10);
begin
  dbms_output.put_line('Line1'||newline||'Line2');
end;
/
how do i dump this into a select type query according to my intial question?
ASKER CERTIFIED SOLUTION
Avatar of johnsone
johnsone
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or, to ensure you get the required heading:

select to_char(reportdate, 'dd-mm-yyyy') || chr(10) || to_date(reportdate, 'hh24:mi:ss') reportdate
from yourtable;