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
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
CHR(10) is enough!
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('Line 1'||newlin e||'Line2' );
end;
/
declare
newline varchar2(1) := chr(10);
begin
dbms_output.put_line('Line
end;
/
ASKER
how do i dump this into a select type query according to my intial question?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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;
select to_char(reportdate, 'dd-mm-yyyy') || chr(10) || to_date(reportdate, 'hh24:mi:ss') reportdate
from yourtable;
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('Line
end;
/