Click here to Skip to main content
12,507,674 members (54,314 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Oracle
Hi ,

i got one requirement like my client will sent me the values , while storing the values i have to add % symbol to that value.

Ex:

create table test(payment number)
insert test values(1)
insert test values(2)
insert test values(0.1)

select * from test

Payment
-------
1%
2%
0.1%

how can i achieve the above output.

Thanks in advance
Posted 2-Jan-13 19:02pm
Updated 2-Jan-13 20:37pm
v3
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Use this select statement .

select to_char([payment number]) || ' %' from test ;
  Permalink  
v2
Comments
FranklinRemo 3-Jan-13 1:46am
   
Hi RDBurmon , thank you for reply.

it is showing the error like 0RA-00936 Missing Expression
RDBurmon 3-Jan-13 1:59am
   
Can you run this query and send me result ?
SELECT [payment number] FROM test;
FranklinRemo 3-Jan-13 2:09am
   
Hi it is giving the same error i.e ORA -00936 Missing Expression.
my column name is payment only then how could you specify [payment number].if i write payment also it is giving same error
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

hi i got the answer by writing the query in this format

SELECT payment || '%'  FROM test_1;
  Permalink  
v3
Comments
RDBurmon 3-Jan-13 2:31am
   
Great

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160927.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100