Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Varchar to Number

ElcoDec 3 2014 — edited Dec 4 2014

Hi,

I have the following SQL statement (see below). The issue is the lin.attribute3 is an varchar column where only numbers are with an point so example 320.52

The lin.price_unit is an number column. Now I get the error invalid number. Does anybody know what the easiest way to solve this is?

Thanks in advanged!


Regards

Elco

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

update okc_k_lines_b lin

set    lin.price_unit = lin.attribute3

where      1=1                                                  

and            lin.dnz_chr_id in

                    ( select hdr.id

                    from          okc_k_headers_all_b hdr

                    where       1=1

                    and          hdr.sts_code           = 'ACTIVE'

                    and          lin.date_terminated is null

                    and          (lin.attribute3 > lin.price_unit OR lin.price_unit IS NULL)

                    and         lin.attribute3 IS NOT NULL);

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2015
Added on Dec 3 2014
14 comments
3,087 views