Casting Decimals in Oracle


Posted on 16th Feb 2014 07:03 pm by admin

This code worked as a query in DB2, but I am not sure what the syntax is for casting decimals in Oracle:

decimal(decimal(A.record_count-A.generic_count-A.unusable_count,10,2) / decimal(B.record_count,10,2) * 100,10,2) usable_percent

The full query is:

SELECT B.load_date,
B.dsrc_id,
C.dsrc_code,
A.table_seq,
A.table_name,
A.record_type,
B.record_count total_records,
A.record_count,
A.generic_count,
A.unusable_count,
A.record_count-A.generic_count-A.unusable_count usable_count,
decimal(decimal(A.record_count-A.generic_count-A.unusable_count,10,2) / decimal(B.record_count,10,2) * 100,10,2) usable_percent
FROM (select load_id, table_seq, table_name, record_type,sum(record_count) record_count, sum(generic_count) generic_count, sum(unusable_count) unusable_count
from umf_sum_quality group by load_id, table_seq, table_name, record_type) A,
(select load_id, dsrc_id, load_date, sum(record_count) record_count
from umf_load_sum group by load_id, dsrc_id, load_date) B,
dsrc_code C
WHERE B.load_id = A.load_id and C.dsrc_id = B.dsrc_id
ORDER BY B.load_date desc, B.dsrc_id, A.table_seq, A.table_name, A.record_type

No comments posted yet

Your Answer:

Login to answer
98 Like 26 Dislike
Previous forums Next forums
Other forums

limitations on array_unique()
Does any one know what/how imitations are applied to array_unique? I have an issue where no matter h

Using loop to count number of entries
I'm writing a program that must ask user to type in numbers. After each entry, the program has to re

a function to check directory depth
I'm working on a php script to upload files in to a set directory.
the user can select to upload

How to change Time Zone
HI
I want to change the time zone of the server to another country.How can do that?

Thanks

How do I give a developer access to a specific directory and nothing else?
I want to give a develop access to a specific directory and nothing else

I can give them an F

Cursor statement failed with errors
Following statement failed with the errors.

cursor proj_cursor1 is (select projectID from

PHP Tab Control
Hi All,

I would like to have PHP tab control with/without Javascript.

But I want to r

passing data from one page to another
hey guys
i have the follwoing code to get information from one page and place on another:

File upload issues
Hi Guys,

Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . dat

Help on code output
My CODE:

Code: [Select] echo "<phone>".$line["phone"].&qu

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash