Home » SQL & PL/SQL » SQL & PL/SQL » format after concat number (Oracle 10g)
format after concat number [message #357611] Thu, 06 November 2008 00:55 Go to next message
Suwarna
Messages: 10
Registered: August 2008
Location: Mumbai
Junior Member
Hi all,


SELECT a.Red_Receipt_Amt FROM Receipt_Details a

Result:
190000.000000000000
100.000000000000
1000.000000000000


SELECT Concat(a.Red_Receipt_Amt,a.Red_Receipt_dt)
FROM Receipt_Details a;

Result:
17-OCT-08|190000
16-OCT-08|100
17-OCT-08|1000


The amount is rounded off after concatenation.
How can i get 17-OCT-08|19000.00 and so - on.
sorry for the format as i am using Pl/sql developer..
Please provide me some guidelines.. Thanks..




Re: format after concat number [message #357624 is a reply to message #357611] Thu, 06 November 2008 01:24 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use TO_CHAR

For format, read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel
Re: format after concat number [message #357707 is a reply to message #357611] Thu, 06 November 2008 05:27 Go to previous messageGo to next message
joicejohn
Messages: 327
Registered: March 2008
Location: India
Senior Member
Suwarna wrote on Thu, 06 November 2008 12:25

SELECT Concat(a.Red_Receipt_Amt,a.Red_Receipt_dt)
FROM Receipt_Details a;

Result:
17-OCT-08|190000
16-OCT-08|100
17-OCT-08|1000



Gee.... I never knew CONCAT Function can swap its arguments upon user's wish. Laughing

Regards,
Jo
Re: format after concat number [message #357710 is a reply to message #357707] Thu, 06 November 2008 05:41 Go to previous message
Suwarna
Messages: 10
Registered: August 2008
Location: Mumbai
Junior Member
oops...

my bad.... i took the output of my main query..
and posted it with the sample query...

anyway, my post is answered.. and it works now..

Thanks Michel..!


Previous Topic: can we give variable contraining sql statment to declare a cursor
Next Topic: Fetching values from tables
Goto Forum:
  


Current Time: Thu Dec 08 00:24:28 CST 2016

Total time taken to generate the page: 0.11377 seconds