Oracle .. question..   Independent houses near kukatpally | Apartments in Pragathi Nagar | AndhraVaani.com | Log Out | Topics | Search
Register | Edit Profile

Bewarse TalkTechnology - Talk Only Tech Oracle .. question.. Previous Next

Author Message
Top of pagePrevious messageNext messageBottom of pageLink to this message

Rediff
Mudiripoyina Bewarse
Username: Rediff

Post Number: 4774
Registered: 03-2004
Posted From: 67.176.15.43

Rating:N/A
Votes: 0(Vote!)

Posted on Saturday, July 30, 2005 - 9:37 pm:Edit PostDelete PostView Post/Check IP

MM mama .. yeah adi display ki work avuddi .. kaanee veellu table lone alaa store cheyaali.. plain select should display the values in req format antaaremo ani alochistunna.. btw, LTRIM(to_char(value,99999.99)) is much better i guess..


YNR mama.. yeah they are diff .. ade naa prob .. format command .. use cheyamani cheppalekapovachu mama.. mostly I will (a) suggest them to use LTRIM_TOCHAR way while selecting or (b) ask them if I can change the column definition to char and if thats the case ..before insertng values do that LTRIM/TOCHAR processing.


thanks mamalooo.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Yendi_naa_royya
Kurra Bewarse
Username: Yendi_naa_royya

Post Number: 699
Registered: 06-2005
Posted From: 68.199.132.27

Rating:N/A
Votes: 0(Vote!)

Posted on Saturday, July 30, 2005 - 7:56 pm:Edit PostDelete PostView Post/Check IP

displaying results and storing values are both different.

SQL> column value1 format 999.99

if u run query now after setting column format then u will get waht u wanted.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Megamama
Mudiripoyina Bewarse
Username: Megamama

Post Number: 5166
Registered: 07-2004
Posted From: 24.98.119.29

Rating:N/A
Votes: 0(Vote!)

Posted on Saturday, July 30, 2005 - 7:46 pm:Edit PostDelete PostView Post/Check IP

maama

naaku database ki inti nundi access ledu..so just hypothetical ga cheppina..just test it out..shud work
Top of pagePrevious messageNext messageBottom of pageLink to this message

Megamama
Mudiripoyina Bewarse
Username: Megamama

Post Number: 5165
Registered: 07-2004
Posted From: 24.98.119.29

Rating:N/A
Votes: 0(Vote!)

Posted on Saturday, July 30, 2005 - 7:44 pm:Edit PostDelete PostView Post/Check IP

check this

select to_char(value1,'NNNN.NN'),to_char(value2,'NNNN.NN' ) from TS_TMP4
Top of pagePrevious messageNext messageBottom of pageLink to this message

Megamama
Mudiripoyina Bewarse
Username: Megamama

Post Number: 5162
Registered: 07-2004
Posted From: 24.98.119.29

Rating:N/A
Votes: 0(Vote!)

Posted on Saturday, July 30, 2005 - 7:31 pm:Edit PostDelete PostView Post/Check IP

voke..will get back to u on this once login to DB
Top of pagePrevious messageNext messageBottom of pageLink to this message

Rediff
Mudiripoyina Bewarse
Username: Rediff

Post Number: 4773
Registered: 03-2004
Posted From: 159.37.7.93

Rating:N/A
Votes: 0(Vote!)

Posted on Saturday, July 30, 2005 - 7:19 pm:Edit PostDelete PostView Post/Check IP

nenu basigga vere table nundi techi data insert cheyaali.. ee destination table lo format alaa vundaali antaa..

so my plan is to define field as char and use tochar and Ltrim before inserting .. I know it would work.. but extra processing and datatype definition change are my concers!!
Top of pagePrevious messageNext messageBottom of pageLink to this message

Rediff
Mudiripoyina Bewarse
Username: Rediff

Post Number: 4772
Registered: 03-2004
Posted From: 159.37.7.93

Rating:N/A
Votes: 0(Vote!)

Posted on Saturday, July 30, 2005 - 7:14 pm:Edit PostDelete PostView Post/Check IP

idigo naa simple test...
----------------------------------

create table TS_TMP4 (value1 number(10,3), value2 number(10));

insert into TS_TMP4 values (10.34,10.34);
insert into TS_TMP4 values (10.84,10.84);
insert into TS_TMP4 values (10,10);
insert into TS_TMP4 values (10.00,10.00);

select * from TS_TMP4;

10.34 10
10.84 11
10 10
10 10


I though it may be storing 10.00 but only displaying as 10 .. so I have executed following query .. still the same result

select to_char(value1),to_char(value2) from TS_TMP4;


-------------
Top of pagePrevious messageNext messageBottom of pageLink to this message

Rediff
Mudiripoyina Bewarse
Username: Rediff

Post Number: 4771
Registered: 03-2004
Posted From: 171.72.5.226

Rating:N/A
Votes: 0(Vote!)

Posted on Saturday, July 30, 2005 - 7:06 pm:Edit PostDelete PostView Post/Check IP

ardam kaaledu mama.. I have already set the precision when i said type as number(x,2) ..right??

using trim will only help reducing the precision of number.. say 12.123 to 12.12 .. but not to increase precision from 12.1 to 12.10 .. probably u meant padding??
Top of pagePrevious messageNext messageBottom of pageLink to this message

Megamama
Mudiripoyina Bewarse
Username: Megamama

Post Number: 5159
Registered: 07-2004
Posted From: 24.98.119.29

Rating:N/A
Votes: 0(Vote!)

Posted on Saturday, July 30, 2005 - 6:25 pm:Edit PostDelete PostView Post/Check IP

Rediff maama

Precession is the only way for your problem and I dont see any problem with integers too because integer itself while inserting ..inserts with the precession...

there is no other way...you can handle any extra digits after precession using LTRIM or RTRIM as required in a procedure or function...

hope am clear..let me know if u still have any doubts
Top of pagePrevious messageNext messageBottom of pageLink to this message

Rediff
Mudiripoyina Bewarse
Username: Rediff

Post Number: 4770
Registered: 03-2004
Posted From: 67.176.15.43

Rating:N/A
Votes: 0(Vote!)

Posted on Saturday, July 30, 2005 - 5:21 pm:Edit PostDelete PostView Post/Check IP

Hello mamaloo..

is there any way to force the scale of numbers in oracle??

i.e 10 needs to be represented as 10.00

setting definition as Number(x,2) is not of any help in the case where some of the values are integers.


thanks in advance