dbTalk Databases Forums  

Concatenate numbers

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Concatenate numbers in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
nickli2000@gmail.com
 
Posts: n/a

Default Concatenate numbers - 01-02-2008 , 11:38 AM






Hi,

I have a table with the following two columns and sample data:

tran_date DATE;
digits NUMBER;

10/2/2007 0.000738889791980111
11/22/2007 0.00083740843091
12/11/2007 6.00083740843091

For a special output, I tried to concatenate the two columns using
the following SQL:

SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits from
mytable;

The result is missing the "0" for two numbers starting with "0."
as in the following:

20071002,.000738889791980111
20071122,.00083740843091
20071211,6.00083740843091 (This is fine)

I know I may be able to do some decode or other manipulation, but
could someone tell me why the leading "0" is omitted from the query
output?

Thanks in advance.

Nick




Reply With Quote
  #2  
Old   
shakespeare
 
Posts: n/a

Default Re: Concatenate numbers - 01-02-2008 , 12:30 PM







<nickli2000 (AT) gmail (DOT) com> schreef in bericht
news:ab51ddb0-77cd-4b01-a899-4094a2995626 (AT) d21g2000prf (DOT) googlegroups.com...
Quote:
Hi,

I have a table with the following two columns and sample data:

tran_date DATE;
digits NUMBER;

10/2/2007 0.000738889791980111
11/22/2007 0.00083740843091
12/11/2007 6.00083740843091

For a special output, I tried to concatenate the two columns using
the following SQL:

SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits from
mytable;

The result is missing the "0" for two numbers starting with "0."
as in the following:

20071002,.000738889791980111
20071122,.00083740843091
20071211,6.00083740843091 (This is fine)

I know I may be able to do some decode or other manipulation, but
could someone tell me why the leading "0" is omitted from the query
output?

Thanks in advance.

Nick



I guess because of an implicit to_char of your digits column:

SQL>select to_char(0.1) from dual;

TO
--
,1

SQL>

(BTW: Note that in my case there is also a conversion of '.' to ',', due to
NLS settings)

Shakespeare




Reply With Quote
  #3  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: Concatenate numbers - 01-02-2008 , 12:49 PM



On Jan 2, 11:38*am, nickli2... (AT) gmail (DOT) com wrote:
Quote:
Hi,

* *I have a table with the following two columns and sample data:

* * tran_date *DATE;
* * digits * * * *NUMBER;

* * 10/2/2007 * * *0.000738889791980111
* * 11/22/2007 * *0.00083740843091
* * 12/11/2007 * *6.00083740843091

* * For a special output, I tried to concatenate the two columns using
the following SQL:

* * SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits from
mytable;

* * The result is missing the "0" for two numbers starting with "0."
as in the following:

* * *20071002,.000738889791980111
* * *20071122,.00083740843091
* * *20071211,6.00083740843091 * *(This is fine)

* * *I know I may be able to do some decode or other manipulation, but
could someone tell me why the leading "0" is omitted from the query
output?

* * Thanks in advance.

* * Nick

Because the leading 0 to the left of the decimal point is not a
significant digit, thus it can be removed without affecting the actual
numeric value. If you really need that value stored in the database
it may be necessary to change the column definition to that of a
varchar2(30):

SQL> create table mytable(
2 tran_date date,
3 digits number
4 );

Table created.

SQL>
SQL> insert all
2 into mytable
3 values (to_date('10/02/2007','MM/DD/YYYY'), 0.000738889791980111)
4 into mytable
5 values (to_date('11/22/2007','MM/DD/YYYY'), 0.00083740843091)
6 into mytable
7 values (to_date('12/11/2007','MM/DD/YYYY'), 6.00083740843091)
8 select * From dual;

3 rows created.

SQL>
SQL> commit;

Commit complete.

SQL>
SQL> SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits
2 from mytable;

TO_CHAR(TRAN_DATE,'YYYYMMDD')||','||DIGITS
-------------------------------------------------
20071002,.000738889791980111
20071122,.00083740843091
20071211,6.00083740843091

SQL>
SQL> drop table mytable;

Table dropped.

SQL>
SQL> create table mytable(
2 tran_date date,
3 digits varchar2(30)
4 );

Table created.

SQL>
SQL> insert all
2 into mytable
3 values (to_date('10/02/2007','MM/DD/YYYY'),
'0.000738889791980111')
4 into mytable
5 values (to_date('11/22/2007','MM/DD/YYYY'), '0.00083740843091')
6 into mytable
7 values (to_date('12/11/2007','MM/DD/YYYY'), '6.00083740843091')
8 select * From dual;

3 rows created.

SQL>
SQL> commit;

Commit complete.

SQL>
SQL> SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits
2 from mytable;

TO_CHAR(TRAN_DATE,'YYYYMMDD')||','||DIG
---------------------------------------
20071002,0.000738889791980111
20071122,0.00083740843091
20071211,6.00083740843091

SQL>


David Fitzjarrell


Reply With Quote
  #4  
Old   
nickli2000@gmail.com
 
Posts: n/a

Default Re: Concatenate numbers - 01-02-2008 , 01:19 PM



On Jan 2, 1:49 pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:
Quote:
On Jan 2, 11:38 am, nickli2... (AT) gmail (DOT) com wrote:



Hi,

I have a table with the following two columns and sample data:

tran_date DATE;
digits NUMBER;

10/2/2007 0.000738889791980111
11/22/2007 0.00083740843091
12/11/2007 6.00083740843091

For a special output, I tried to concatenate the two columns using
the following SQL:

SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits from
mytable;

The result is missing the "0" for two numbers starting with "0."
as in the following:

20071002,.000738889791980111
20071122,.00083740843091
20071211,6.00083740843091 (This is fine)

I know I may be able to do some decode or other manipulation, but
could someone tell me why the leading "0" is omitted from the query
output?

Thanks in advance.

Nick

Because the leading 0 to the left of the decimal point is not a
significant digit, thus it can be removed without affecting the actual
numeric value. If you really need that value stored in the database
it may be necessary to change the column definition to that of a
varchar2(30):

SQL> create table mytable(
2 tran_date date,
3 digits number
4 );

Table created.

SQL
SQL> insert all
2 into mytable
3 values (to_date('10/02/2007','MM/DD/YYYY'), 0.000738889791980111)
4 into mytable
5 values (to_date('11/22/2007','MM/DD/YYYY'), 0.00083740843091)
6 into mytable
7 values (to_date('12/11/2007','MM/DD/YYYY'), 6.00083740843091)
8 select * From dual;

3 rows created.

SQL
SQL> commit;

Commit complete.

SQL
SQL> SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits
2 from mytable;

TO_CHAR(TRAN_DATE,'YYYYMMDD')||','||DIGITS
-------------------------------------------------
20071002,.000738889791980111
20071122,.00083740843091
20071211,6.00083740843091

SQL
SQL> drop table mytable;

Table dropped.

SQL
SQL> create table mytable(
2 tran_date date,
3 digits varchar2(30)
4 );

Table created.

SQL
SQL> insert all
2 into mytable
3 values (to_date('10/02/2007','MM/DD/YYYY'),
'0.000738889791980111')
4 into mytable
5 values (to_date('11/22/2007','MM/DD/YYYY'), '0.00083740843091')
6 into mytable
7 values (to_date('12/11/2007','MM/DD/YYYY'), '6.00083740843091')
8 select * From dual;

3 rows created.

SQL
SQL> commit;

Commit complete.

SQL
SQL> SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits
2 from mytable;

TO_CHAR(TRAN_DATE,'YYYYMMDD')||','||DIG
---------------------------------------
20071002,0.000738889791980111
20071122,0.00083740843091
20071211,6.00083740843091

SQL

David Fitzjarrell
Thanks for your help. Could you tell me why Oracle decides to omit the
leading "0" when concatenating the numbers and what settings affect
this?


Reply With Quote
  #5  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: Concatenate numbers - 01-02-2008 , 02:10 PM





nickli2... (AT) gmail (DOT) com wrote:
Quote:
On Jan 2, 1:49 pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:
On Jan 2, 11:38 am, nickli2... (AT) gmail (DOT) com wrote:



Hi,

I have a table with the following two columns and sample data:

tran_date DATE;
digits NUMBER;

10/2/2007 0.000738889791980111
11/22/2007 0.00083740843091
12/11/2007 6.00083740843091

For a special output, I tried to concatenate the two columns using
the following SQL:

SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits from
mytable;

The result is missing the "0" for two numbers starting with "0."
as in the following:

20071002,.000738889791980111
20071122,.00083740843091
20071211,6.00083740843091 (This is fine)

I know I may be able to do some decode or other manipulation, but
could someone tell me why the leading "0" is omitted from the query
output?

Thanks in advance.

Nick

Because the leading 0 to the left of the decimal point is not a
significant digit, thus it can be removed without affecting the actual
numeric value. If you really need that value stored in the database
it may be necessary to change the column definition to that of a
varchar2(30):

SQL> create table mytable(
2 tran_date date,
3 digits number
4 );

Table created.

SQL
SQL> insert all
2 into mytable
3 values (to_date('10/02/2007','MM/DD/YYYY'), 0.000738889791980111)
4 into mytable
5 values (to_date('11/22/2007','MM/DD/YYYY'), 0.00083740843091)
6 into mytable
7 values (to_date('12/11/2007','MM/DD/YYYY'), 6.00083740843091)
8 select * From dual;

3 rows created.

SQL
SQL> commit;

Commit complete.

SQL
SQL> SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits
2 from mytable;

TO_CHAR(TRAN_DATE,'YYYYMMDD')||','||DIGITS
-------------------------------------------------
20071002,.000738889791980111
20071122,.00083740843091
20071211,6.00083740843091

SQL
SQL> drop table mytable;

Table dropped.

SQL
SQL> create table mytable(
2 tran_date date,
3 digits varchar2(30)
4 );

Table created.

SQL
SQL> insert all
2 into mytable
3 values (to_date('10/02/2007','MM/DD/YYYY'),
'0.000738889791980111')
4 into mytable
5 values (to_date('11/22/2007','MM/DD/YYYY'), '0.00083740843091')
6 into mytable
7 values (to_date('12/11/2007','MM/DD/YYYY'), '6.00083740843091')
8 select * From dual;

3 rows created.

SQL
SQL> commit;

Commit complete.

SQL
SQL> SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits
2 from mytable;

TO_CHAR(TRAN_DATE,'YYYYMMDD')||','||DIG
---------------------------------------
20071002,0.000738889791980111
20071122,0.00083740843091
20071211,6.00083740843091

SQL

David Fitzjarrell

Thanks for your help. Could you tell me why Oracle decides to omit the
leading "0" when concatenating the numbers and what settings affect
this?
NO settings affect this and I've already informed you as to WHY. You
can scroll up and read the explanation again.


David Fitzjarrell


Reply With Quote
  #6  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Concatenate numbers - 01-02-2008 , 02:30 PM



On Jan 2, 2:19*pm, nickli2... (AT) gmail (DOT) com wrote:
Quote:
On Jan 2, 1:49 pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:





On Jan 2, 11:38 am, nickli2... (AT) gmail (DOT) com wrote:

Hi,

* *I have a table with the following two columns and sample data:

* * tran_date *DATE;
* * digits * * * *NUMBER;

* * 10/2/2007 * * *0.000738889791980111
* * 11/22/2007 * *0.00083740843091
* * 12/11/2007 * *6.00083740843091

* * For a special output, I tried to concatenate the two columns using
the following SQL:

* * SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits from
mytable;

* * The result is missing the "0" for two numbers starting with "0.."
as in the following:

* * *20071002,.000738889791980111
* * *20071122,.00083740843091
* * *20071211,6.00083740843091 * *(This is fine)

* * *I know I may be able to do some decode or other manipulation, but
could someone tell me why the leading "0" is omitted from the query
output?

* * Thanks in advance.

* * Nick
[]

Thanks for your help. Could you tell me why Oracle decides to omit the
leading "0" when concatenating the numbers and what settings affect
this?


Changing the datatype to VARCHAR seems like overkill. Numeric data
should be stored in numeric data types. I would suggest using the
correct number format for the output. I think
set numformat 0.999999999999999999
should work. Or using that format pattern with the column command:
column digits format 0.999999999999999999
should give your desired result.

(note: I did not test this pattern, but the syntax of the commands is
correct.)

HTH,
ed


Reply With Quote
  #7  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: Concatenate numbers - 01-02-2008 , 02:38 PM



On Jan 2, 2:30*pm, Ed Prochak <edproc... (AT) gmail (DOT) com> wrote:
Quote:
On Jan 2, 2:19*pm, nickli2... (AT) gmail (DOT) com wrote:





On Jan 2, 1:49 pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:

On Jan 2, 11:38 am, nickli2... (AT) gmail (DOT) com wrote:

Hi,

* *I have a table with the following two columns and sample data:

* * tran_date *DATE;
* * digits * * * *NUMBER;

* * 10/2/2007 * * *0.000738889791980111
* * 11/22/2007 * *0.00083740843091
* * 12/11/2007 * *6.00083740843091

* * For a special output, I tried to concatenate the two columnsusing
the following SQL:

* * SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits from
mytable;

* * The result is missing the "0" for two numbers starting with "0."
as in the following:

* * *20071002,.000738889791980111
* * *20071122,.00083740843091
* * *20071211,6.00083740843091 * *(This is fine)

* * *I know I may be able to do some decode or other manipulation, but
could someone tell me why the leading "0" is omitted from the query
output?

* * Thanks in advance.

* * Nick
[]

Thanks for your help. Could you tell me why Oracle decides to omit the
leading "0" when concatenating the numbers and what settings affect
this?

Changing the datatype to VARCHAR seems like overkill. Numeric data
should be stored in numeric data types. I would suggest using the
correct number format for the output. I think
set numformat * 0.999999999999999999
should work. Or using that format pattern with the column command:
column digits format *0.999999999999999999
should give your desired result.

(note: I did not test this pattern, but the syntax of the commands is
correct.)

HTH,
* ed- Hide quoted text -

- Show quoted text -
I have tested such a 'fix' and it doesn't do what the OP requests.
The concatenation operation, along with an implicit conversion, 'lops
off' the leading 0 (again, as it's not a significant digit).

Preserving the leading 0 is, at least in 10.2.0.3 and earlier
releases, only possible with the data stored as a varchar2.


David Fitzjarrell


Reply With Quote
  #8  
Old   
Ken Denny
 
Posts: n/a

Default Re: Concatenate numbers - 01-02-2008 , 03:12 PM



On Jan 2, 3:38*pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:
Quote:
On Jan 2, 2:30*pm, Ed Prochak <edproc... (AT) gmail (DOT) com> wrote:





On Jan 2, 2:19*pm, nickli2... (AT) gmail (DOT) com wrote:

On Jan 2, 1:49 pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:

On Jan 2, 11:38 am, nickli2... (AT) gmail (DOT) com wrote:

Hi,

* *I have a table with the following two columns and sample data:

* * tran_date *DATE;
* * digits * * * *NUMBER;

* * 10/2/2007 * * *0.000738889791980111
* * 11/22/2007 * *0.00083740843091
* * 12/11/2007 * *6.00083740843091

* * For a special output, I tried to concatenate the two columns using
the following SQL:

* * SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits from
mytable;

* * The result is missing the "0" for two numbers starting with "0."
as in the following:

* * *20071002,.000738889791980111
* * *20071122,.00083740843091
* * *20071211,6.00083740843091 * *(This is fine)

* * *I know I may be able to do some decode or other manipulation, but
could someone tell me why the leading "0" is omitted from the query
output?

* * Thanks in advance.

* * Nick
[]

Thanks for your help. Could you tell me why Oracle decides to omit the
leading "0" when concatenating the numbers and what settings affect
this?

Changing the datatype to VARCHAR seems like overkill. Numeric data
should be stored in numeric data types. I would suggest using the
correct number format for the output. I think
set numformat * 0.999999999999999999
should work. Or using that format pattern with the column command:
column digits format *0.999999999999999999
should give your desired result.

(note: I did not test this pattern, but the syntax of the commands is
correct.)

HTH,
* ed- Hide quoted text -

- Show quoted text -

I have tested such a 'fix' and it doesn't do what the OP requests.
The concatenation operation, along with an implicit conversion, 'lops
off' the leading 0 (again, as it's not a significant digit).

Preserving the leading 0 is, at least in 10.2.0.3 and earlier
releases, only possible with the data stored as a varchar2.

David Fitzjarrell
I tested it and it does what he wants. There are two problems though.
First it inserts a space before the number, second is that you must
have a fixed number of digits after the decimal. The first can be
remedied using a substr and the second by using a format mask with the
maximum number of decimal places then using rtrim to remove the
trailing 0's

SQL> select to_char(sysdate,'YYYYMMDD')||','||to_char(0.8,'0.9 9999')
from dual;

TO_CHAR(SYSDATE,'
-----------------
20080102, 0.80000

SQL> select to_char(sysdate,'yyyymmdd')||','||
rtrim(substr(to_char(0.8,'0.99999'),2),'0') from dual;


TO_CHAR(SYSDATE,'YYYYMMDD')||','||RTR
-------------------------------------
20080102,0.8


Reply With Quote
  #9  
Old   
Maxim Demenko
 
Posts: n/a

Default Re: Concatenate numbers - 01-02-2008 , 05:15 PM



Ken Denny schrieb:
Quote:
On Jan 2, 3:38 pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:
On Jan 2, 2:30 pm, Ed Prochak <edproc... (AT) gmail (DOT) com> wrote:





On Jan 2, 2:19 pm, nickli2... (AT) gmail (DOT) com wrote:
On Jan 2, 1:49 pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:
On Jan 2, 11:38 am, nickli2... (AT) gmail (DOT) com wrote:
Hi,
I have a table with the following two columns and sample data:
tran_date DATE;
digits NUMBER;
10/2/2007 0.000738889791980111
11/22/2007 0.00083740843091
12/11/2007 6.00083740843091
For a special output, I tried to concatenate the two columns using
the following SQL:
SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits from
mytable;
The result is missing the "0" for two numbers starting with "0."
as in the following:
20071002,.000738889791980111
20071122,.00083740843091
20071211,6.00083740843091 (This is fine)
I know I may be able to do some decode or other manipulation, but
could someone tell me why the leading "0" is omitted from the query
output?
Thanks in advance.
Nick
[]
Thanks for your help. Could you tell me why Oracle decides to omit the
leading "0" when concatenating the numbers and what settings affect
this?
Changing the datatype to VARCHAR seems like overkill. Numeric data
should be stored in numeric data types. I would suggest using the
correct number format for the output. I think
set numformat 0.999999999999999999
should work. Or using that format pattern with the column command:
column digits format 0.999999999999999999
should give your desired result.
(note: I did not test this pattern, but the syntax of the commands is
correct.)
HTH,
ed- Hide quoted text -
- Show quoted text -
I have tested such a 'fix' and it doesn't do what the OP requests.
The concatenation operation, along with an implicit conversion, 'lops
off' the leading 0 (again, as it's not a significant digit).

Preserving the leading 0 is, at least in 10.2.0.3 and earlier
releases, only possible with the data stored as a varchar2.

David Fitzjarrell

I tested it and it does what he wants.
You tested another workaround.

There are two problems though.
Quote:
First it inserts a space before the number, second is that you must
have a fixed number of digits after the decimal. The first can be
remedied using a substr and the second by using a format mask with the
maximum number of decimal places then using rtrim to remove the
trailing 0's
Look up in the SQL Reference about 'FM' format modifier.

SQL> select to_char(sysdate,'yyyymmdd')||','||to_char(0.8,'fm0 .99999')
from dual;

TO_CHAR(SYSDATE,'
-----------------
20080103,0.8



Best regards

Maxim


Reply With Quote
  #10  
Old   
Ken Denny
 
Posts: n/a

Default Re: Concatenate numbers - 01-03-2008 , 06:54 AM



On Jan 2, 6:15*pm, Maxim Demenko <mdeme... (AT) gmail (DOT) com> wrote:
Quote:
Ken Denny schrieb:





On Jan 2, 3:38 pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:
On Jan 2, 2:30 pm, Ed Prochak <edproc... (AT) gmail (DOT) com> wrote:

On Jan 2, 2:19 pm, nickli2... (AT) gmail (DOT) com wrote:
On Jan 2, 1:49 pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:
On Jan 2, 11:38 am, nickli2... (AT) gmail (DOT) com wrote:
Hi,
* *I have a table with the following two columns and sample data:
* * tran_date *DATE;
* * digits * * * *NUMBER;
* * 10/2/2007 * * *0.000738889791980111
* * 11/22/2007 * *0.00083740843091
* * 12/11/2007 * *6.00083740843091
* * For a special output, I tried to concatenate the two columns using
the following SQL:
* * SELECT to_char(tran_date,'YYYYMMDD') || ',' || digits from
mytable;
* * The result is missing the "0" for two numbers starting with"0."
as in the following:
* * *20071002,.000738889791980111
* * *20071122,.00083740843091
* * *20071211,6.00083740843091 * *(This is fine)
* * *I know I may be able to do some decode or other manipulation, but
could someone tell me why the leading "0" is omitted from the query
output?
* * Thanks in advance.
* * Nick
[]
Thanks for your help. Could you tell me why Oracle decides to omit the
leading "0" when concatenating the numbers and what settings affect
this?
Changing the datatype to VARCHAR seems like overkill. Numeric data
should be stored in numeric data types. I would suggest using the
correct number format for the output. I think
set numformat * 0.999999999999999999
should work. Or using that format pattern with the column command:
column digits format *0.999999999999999999
should give your desired result.
(note: I did not test this pattern, but the syntax of the commands is
correct.)
HTH,
* ed- Hide quoted text -
- Show quoted text -
I have tested such a 'fix' and it doesn't do what the OP requests.
The concatenation operation, along with an implicit conversion, 'lops
off' the leading 0 (again, as it's not a significant digit).

Preserving the leading 0 is, at least in 10.2.0.3 and earlier
releases, only possible with the data stored as a varchar2.

David Fitzjarrell

I tested it and it does what he wants.

You tested another workaround.
You're right. I didn't read Ed's reply carefully.
Quote:
There are two problems though.

First it inserts a space before the number, second is that you must
have a fixed number of digits after the decimal. The first can be
remedied using a substr and the second by using a format mask with the
maximum number of decimal places then using rtrim to remove the
trailing 0's

Look up in the SQL Reference about 'FM' format modifier.

SQL> select to_char(sysdate,'yyyymmdd')||','||to_char(0.8,'fm0 .99999')
from dual;

TO_CHAR(SYSDATE,'
-----------------
20080103,0.8

Best regards

Maxim
Thanks Maxim. I haven't used the 'FM' before. Glad to know about it.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.