Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Datatype conversion

Datatype conversion

From: <roland.skoldblom_at_ica.se>
Date: Thu, 06 Nov 2003 08:34:27 -0800
Message-ID: <F001.005D5D7D.20031106083427@fatcity.com>


Hallo,

I have a table, A: IMPEXCEL_EANNR

which contains the field IMP_PRIS(= price)

It looks like this:

12
1,50
11

This is a varchar2 field in this table. I want that field values to be inserted(or rather update the other table ) in other table called VARUKORGEANREL, but field in which the prices are goingto be inserted to is a NUMBER(15,5) field.

I am trying to use this sql but the result I get is:

0,12
1,50
0,11

The right prices to be inserted would be 12
1,50
11

What is wrong with this sql?

   UPDATE PBK.VARUKORGEANREL SET (

               PRIS) =
                 (SELECT Distinct to_number ( substr(pbk.impexcel_eannr.IMP_PRIS,1,(instr(pbk.impexcel_eannr.IMP_PRIS,',')-1))||'.'|| substr(pbk.impexcel_eannr.IMP_PRIS,(instr(pbk.impexcel_eannr.IMP_PRIS,',')+1),length(pbk.impexcel_eannr.IMP_PRIS)))
                   FROM PBK.impexcel_eannr
                   WHERE PBK.VArukorgeanrel.ean = PBK.impexcel_eannr.EANNUM)
                   WHERE PBK.varukorgeanrel.varukorgid = inVarukorgId;




Thanks in advance

Roland

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author:
  INET: roland.skoldblom_at_ica.se

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Nov 06 2003 - 10:34:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US