Conversion of Decimal datatype

Post Author: tanuja.patankar
CA Forum: Data Integration
Hi Friends,
I am pretty new to DI 11.7 but I am experiencing a funny issue.I have a calculation in my query transform which has A/B where A is a decimal(10,2) and B is int .The output calculation column does not retain the decimal numbers .I tried the following :-
1.Made the calculated collumn as a decimal(10,2), it didnt work.
2.Made the collumn B to a decimal(10,2) it didnt work.
3.Used To_char to convert the calculation in char to retain the decimal numbers, it didnt work.
4.Used concatenation operator making the calculated column as a varchar:-'To_char(A/B)||'.'||To_Char(Mod(A,B)),it didnt work.
5.Tried To_Decimal and to_Decimal_ext, it didnt work
6.Tried using Cast() function , it didnt work too.
Hence if the output of the calculation is 122.34 i would always end up getting 122.00 or 122.
Please help and let me know if there is anyother way to go about it.
Best Regards,
Tanuja

Post Author: bbatenburg
CA Forum: Data Integration
It seems you tried quite a lot. For problem solving you can use the validation is_valid_decimal/ is_valid_int. This should help you pinpointing the location of the problem. I always them when i encounter problems with datatypes.

Similar Messages

  • Conversion of Decimal to Binary String

    Hello Labview People:
    I'm rather new to Labview, so this may be a simple-minded question . . .
    I would like to take a numeric control and have the decimal input
    converted to a binary string of 8 bits. So, for example, if I were to
    put in the number '127', I would get out (on an indicator) the string:
    01111111
    The number '128' would show on the indicator as:
    10000000
    It seems to me that this should be simple, but somehow I cannot figure
    out how to do it. Must an array be built bit by bit to accomplish this?
    (I'm afraid I don't yet know how to build arrays.)
    Thanks in advance for any help you provide!
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    Or, you can go under the numeric function, and look for conversions, get
    decimal to byte array conversion.
    Then what you need to do is to get an array selection vi, and index to zero.
    I don't remember the exact name of the VI's because I don't have LabView
    here with me.
    Perhaps this complicates things
    Steven
    "Timo Miettunen" wrote in message
    news:[email protected]..
    > use format into string VI from string palette
    >
    > format string should be "%08b" for 8 bits, "%016b" for 16 bits etc.
    >
    > timo
    >
    > Ananda Dave wrote:
    > >
    > > Hello Labview People:
    > >
    > > I'm rather new to Labview, so this may be a simple-minded question . . .
    > >
    > > I would like to take a numeric control and have the decimal input
    > >
    converted to a binary string of 8 bits. So, for example, if I were to
    > > put in the number '127', I would get out (on an indicator) the string:
    > >
    > > 01111111
    > >
    > > The number '128' would show on the indicator as:
    > >
    > > 10000000
    > >
    > > It seems to me that this should be simple, but somehow I cannot figure
    > > out how to do it. Must an array be built bit by bit to accomplish this?
    > > (I'm afraid I don't yet know how to build arrays.)
    > >
    > > Thanks in advance for any help you provide!
    > >
    > > Sent via Deja.com http://www.deja.com/
    > > Before you buy.
    >
    > --
    > -------------------------------------------------
    > Timo Miettunen
    >
    > Fincitec Oy Production Department
    > e-mail: [email protected]
    > Address:
    > Lumikontie 2 Tel: +358-16-2151245
    > PO BOX 11 Fax: +358-16-221561
    > FIN-94600 KEMI Finland
    > -------------------------------------------------

  • Sql decimal datatype

    I'm using labview 7.1 with the database connectivity toolkit to interact with a sql server.  One column is of the datatype float, but when I send 0.95, it stores 0.94999999.  I've read about this before, but trying to use numeric or decimal causes a different problem.  When the column is of one of these datatypes and I do a fetch of the data, nothing in that column comes back.  I'm leaving the data as a variant in labview, so it isn't a conversion issue.  I get just a blank variant box.  It works only for float.  And the other columns all work fine. 
    Are decimal and numeric types not supported by labview, and if so how do I get around the inaccuracy of float datatypes?

    Fractional floating point numbers can often not be represented exactly in binary, even if they are nice and round in decimal.
    0.95 for example is actually 0.949999999999999955(DBL) or 0.9499999880791(SGL). There is nothing wrong with that. You simply need to set your display to only show the desired number of significant digits.
    ejoseph wrote:
    Are decimal and numeric types not supported by labview, and if so how do I get around the inaccuracy of float datatypes?
    There is no real inaccuracy. The difference between 0.94999999 and 0.95 is 0.00000001 or about 1 in 100000000! (This is just the diplayed part, the difference in real life is even less. Is your number really more precise that 52bits? (or 23bits for SGL).
    LabVIEW Champion . Do more with less code and in less time .

  • BIG DECIMAL DATATYPE ISSUE IN JDEV 10.1.3.2 ADF BC

    I am developing a small application on mysql db. in one of my entry screens i have to input numeric data upto a 4 decimal places.
    My project settings are SQL92 and JAVA types.
    My dataype for the numeric field in db is double(17,4) at entity level i have kept it to bigdecimal.
    When i enter something as 1200.1223 and save it . it saves correctly but when i modify the same record i get 1200.1222222292222291 value in my input box.
    can any body help what i am doing wrong?
    regards
    Amit

    Pravin
    We dont get number datatype if you have SQL92 selected as SQL Flavour. So i dont think this would help. SQL TYPE Map is JAVA basically in my project. Do you want me to import some of oracle.jbo.domains specifically or something else you want me to do
    regards
    Amit

  • Conversion of BLOB datatype to CLOB datatype

    Hi,
    I would need to convert the column datatype from BLOB to CLOB. currently in the table, the BLOB column has the data. the requirement is to convert this column from BLOB to CLOB datatype.
    please help me how to convert from BLOB datatype to CLOB datatype
    Thanks
    Hari.

    I have just been dealing with the same issue -- mass conversion of data in BLOB form to CLOB. I think I've finally got it working well. I have a table that has an key column then both a BLOB and a CLOB column. I load the BLOBS into the table then run the following PLSQL block (uses the given proc) to transfer the data from the BLOB column to the CLOB column.
    -- Proc to convert BLOB to CLOB
    create or replace function stg.blob_to_clob( p_blb in blob )  return clob  is
       v_clb   clob    ;
       v_dst   integer := 1 ;
       v_src   integer := 1 ;
       v_wrn   integer ;
       v_lng   integer := dbms_lob.default_lang_ctx ;
    begin
       dbms_lob.createtemporary ( v_clb, false ) ;
       dbms_lob.converttoclob
         ( dest_lob      =>  v_clb
         , src_blob      =>  p_blb
         , amount        =>  dbms_lob.lobmaxsize
         , dest_offset   =>  v_dst
         , src_offset    =>  v_src
         , blob_csid     =>  dbms_lob.default_csid
         , lang_context  =>  v_lng
         , warning       =>  v_wrn
       if  ( dbms_lob.NO_WARNING != v_wrn )  then
          v_clb := '~~~{ Error: Invalid Character in source BLOB }~~~' ;
       end if ;
       return v_clb ;     
    exception
       when others then
          v_clb := '~~~{ Error: BLOB Conversion Function Failed }~~~' ;
          return v_clb ;
    end ;
    -- Use the proc above to convert each BLOB to a CLOB in the given table.
    declare
       cursor c1 is
          /* Select the BLOBS to be converted. */
          select  id,  m_blob,  m_clob
            from  stg.temp_cnvrt
                  /* Trying to convert NULL BLOBS will result in an error */
           where  dbms_lob.getlength(m_blob) > 0
          for update ;
       v_tmp_clob   clob ;
    begin
       FOR  nxt in c1  LOOP
          v_tmp_clob := stg.blob_to_clob( nxt.m_blob ) ;
          update  stg.temp_cnvrt
             set  m_clob = v_tmp_clob
           where  current of c1 ;  
       END LOOP ;
       commit ;
    end ;

  • Decimal Datatype

    Hi ,
    I have a table in which one column is of datatype is number(13,5) if i store 35.99 it is retrieved in the same way but if i store 35.00 i retrieve it as 35.

    Manaat wrote:
    Hi ,
    I have a table in which one column is of datatype is number(13,5) if i store 35.99 it is retrieved in the same way but if i store 35.00 i retrieve it as 35.That's the way it works. 35.00 really has no decimal precision, so why store it?
    If you need to DISPLAY the data in that format, query it like ...
    TUBBY_TUBBZ?select to_char(some_number, 'fm99.00')
      2  from
      3  (
      4     select 9 as some_number
      5     from dual
      6  );
    TO_CHAR(SOME_NUMBE
    9.00
    1 row selected.
    Elapsed: 00:00:00.01
    TUBBY_TUBBZ?

  • Sybase ODBC driver - numeric or decimal datatype problem

    Hello!
    I have Sybase Adaptive Server Enterprise 15.0.2 and Oracle 10.2.0 ("show release" in SQL*plus prints 1002000100) on the same machine (OS = Windows XP, name = Workstation). I wanna load correct information from the table in Sybase via Oracle database link.
    Well, I've edited tnsnames.ora, listener.ora. Also I've created initmysybase.ora in hs\admin directory. And, of course, set up DSN (using Sybase ODBC driver) via odbcad32.exe - and named it "mysybase".
    Table ("test", user = guest) definition in Sybase is:
    column "id" - int, column "data_num" - numeric(10, 5), column "data_dec" - decimal(10, 5). And it's content is: (1, 1.12345, 5.54321). I've set up a database link.
    My problem is that whenever I do the SELECT statement (SELECT * FROM "guest.test"@mysybase) I get 0 (zero) for both data_num and data_dec columns.
    Status of investigation:
    The "describe" command in SQL*plus returns:
    id NOT NULL NUMBER(10)
    data_num NUMBER(10,5)
    data_dec NUMBER(10,5)
    UPDATE statement works perfectly.
    I've downloaded a trial version of ODBC drivers from www.datadirect.com and all works fine.
    So, I believe that maybe there are some bugs in ODBC driver from Sybase, or maybe I should configure smth.
    My initmysybase.ora:
    HS_FDS_CONNECT_INFO = mysybase
    # HS_FDS_TRACE_LEVEL = DEBUG
    HS_FDS_TRACE_LEVEL = ON
    HS_NLS_NUMERIC_CHARACTER = ",."
    HS_LANGUAGE = American
    tnsnames.ora:
    mysybase =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = WORKSTATION)(PORT = 1521))
    (CONNECT_DATA =
    (SID = mysybase)
    (HS = OK)
    listener.ora:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = WORKSTATION)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = mysybase)
    (SID_NAME = mysybase)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (PROGRAM = hsodbc)
    So, maybe anybody know how to solve this problem?
    Thanks,
    Yury

    I've played with HS_LANGUAGE option but without success.
    Well, this is the export from the registry:
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\mysybase]
    "Driver"="C:\\sybase\\DataAccess\\ODBC\\dll\\sybdrvodb.dll"
    "dsprincipal"=""
    "secondaryport"=""
    "logintimeout"="10"
    "dsn"="mysybase"
    "restrictmaximumpacketsize"="0"
    "initializationstring"=""
    "database"=""
    "packetsize"=""
    "ignoreerrorsifrspending"="0"
    "dsservicename"=""
    "server"="WORKSTATION"
    "serverinitiatedtransactions"="1"
    "quotedidentifier"="0"
    "charset"="ServerDefault"
    "ansinull"="0"
    "encryptpassword"="0"
    "fetcharraysize"="25"
    "language"=""
    "buffercachesize"="20"
    "trustedfile"=""
    "port"="5000"
    "userid"="sa"
    "hasession"="0"
    "tightlycoupledtransaction"="0"
    "serverprincipal"=""
    "enableserverpacketsize"="1"
    "applicationname"=""
    "description"=""
    "dsurl"=""
    "userprincipal"=""
    "dynamicprepare"="0"
    "crc"="0"
    "secondaryserver"=""
    "textsize"=""
    "clienthostproc"=""
    "clienthostname"=""
    "codepagetype"="oem"

  • Conversion from decimal to char

    Hi experts,
    i am using some function module which has parameter of type char(132) . now i have to pass packed no  p(7) decimals 3 
    to  this how to do it .  if i send directly function module raising run time error ( type conflict).
    how we can do this.
    regards,
    santosh.

    Hi Santosh,
    Try this code for conversion.
    DATA: AMOUNT(7) TYPE P DECIMALS 3.
    DATA : VAR TYPE CHAR13.
    DATA : VAR_1(132).
    AMOUNT = '12345.333'.
    WRITE AMOUNT TO VAR.
    VAR_1 = VAR.
    CONDENSE VAR_1.
    AND PASS THE VALUE OF VAR_1 TO YOUR FM.
    HOPE THIS WILL SOLVE YOUR PROBLEM.

  • Conversion of decimal number

    hi,
    how to convert a decimal number
    suppose i want to convert 500.00- to 500.
    plz help me in resolving this.

    Hi Ramya,
    You can use Field symbol with CASTING operator to convert decimal to Numeric Type (Intergers). You can try with other Numeric type also.
    data:wf_int type i,
    wf_dec(10) type x.
    field-symbols: <fs> type any.
    wf_dec = '28'.
    assign wf_dec to <fs> casting type i.
    wf_int = <fs>.
    write wf_int.
    kindly reward if helpful.
    cheers,
    Hema.

  • Conversión decimal a hexadecimal

    ¡Hola!
          Quiero convertir un número decimal en hexadecimal. A medida que varíe un "pointer slide" con valores decimales, un indicador númerico me vaya mostrando dicho numero pero en formato hexadecimal.
    ¿Se puede, alguien sabe cómo hacerlo?
    Adjunto una imagen de la idea para que sea más clara la pregunta.
    Saludos.
    Adjuntos:
    Ejemplo.png ‏7 KB

    Estoy controlando un variador de velocidad por medio de Modbus (empleo una conexión RS485). Dicho variador se programa con formato HEXADECIMAL.
    Para lograr esto estoy utilizando la libreria Modbus, en la cual sus entrada acepta un valor U16 (unsigned 16 bits).
    La pregunta es:
    ¿Cómo hago o existe algun bloque para convertir un número decimal (el cual lo voy variando con una perilla desde el panel frontal) en U16 hexadecimal? Usé un conversor decimal/hexadecimal pero la salida del mismo es un string y esto no me sirve.
    Adjunto una imagen para que sea más claro.
    Adjuntos:
    Esquema.JPG ‏45 KB

  • File content conversion : hexa decimal character value for tab

    Experts,
       I am working on a FCC for a tab delimited file. Can any one tell me what is the hexadecimal value of tab. I am using '0x09' but it is not recognizing this.
    Can anyone help me out..
    Thanks
    Veeru

    Hi Veeru,
    >    I am working on a FCC for a tab delimited file. Can any one tell me what is the hexadecimal value of tab. I am using '0x09' but it is not recognizing this.
    Have a look at this bolg /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter . You can try the 2nd method given in that. If that doesn't solve your issue, might be there is some other problem in the FCC configuration.
    Regards,
    Sunil Chandra

  • Conversion form Generic datatype

    Hi,
    i am new to ABAP objects.   I have created one method.. the input parameters i have passed generic type 'DATA' for all parameters like i_PERNR,i_BEGDA,i_ENDDA,i_BUKRS etc.  passed this parameters to directly select statement there is a error it is showing can any body help me how to convert this generic to data

    Hi,
      Can anybody help me how to implement Interactive ALV in web dynpro, for primary and secondary views default Excel download and Print options should be there. On the first view total count no. will be there after clicking of that count the second view should display with deatil. can anybody help me how to do this implementation or pls provide if any document is there.
    Regards,
    Raj

  • Conversion from decimal to binary!

    int i=1234;How can I convert an integer to its binary form??

    int i = 1234;
    String binInt = Integer.toBinaryString(i);

  • How to handle DECIMAL MySQL datatype converted to DOUBLE in OBIEE 10gR3?

    Dear all,
    I have a problem in OBIEE 10g namely I use MySQL database as direct datasource to OBI server and I have a column in a table in MySQL which was designed as DECIMAL datatype (18,0).
    This column is used for measuring a duration, and the values are figured in seconds (without decimals), in form like:
    '1200'
    in MySQL database.
    After import the related MySQL table to OBI repository, the OBIEE converts the column in DECIMAL datatype to DOUBLE PRECISION datatype automatically.
    My object is to achieve values in such form, certainly in duration sense (not in time !):
    hh mm ss
    In order to accomplish it I've tried to change the column format with function ROUND:
    ROUND(db.table.column / *3600*, 2)
    The problem is that it works well only if the values can be divided with no remainder e.g.
    original value: 7200
    new value (ROUND): 2
    In case of my example:
    original value: 1200
    new value (ROUND): 0
    This is wrong, because 1200 seconds are not equal with 0 hour, I wish to see there either _0.33333_ hours OR I prefer much more _0 hour 20 min_
    Have somebody any ideas?
    I've tried to make a view in database and import it as CHAR datatype to database but it is not solution also, because if I filter in BI application or try to make a SUM the BI would drop errors..
    Regards,
    Laszlo

    Hi,
    Refer this links,this is exactly fulfill your requirement.
    OBIEE 11g - Change seconds to DD HH:MM:SS format
    OBIEE Functions
    share the updates..... :)
    mark if helpful/correct....

  • Decimal of SQL Server getting converted to Whole number in ORACLE

    Hi All,
    I am using ORACLESQL Developer tool to migrate database from SQL Server to ORACLE. The decimal datatype in Sql Server is not getting converted to its equivalent in ORACLE. Do anyone face the same problem? Its getting converted to WHOLE number.
    Also I am able to import data only from Excel sheet. Is therre any other option to import data using this tool?
    Also is the tool the best to use for migration? Please give me your suggestions pls since I am facing this conversion problem after import lakhs of data.
    I am using version 1.1.3
    Thanks in Advance,
    Srinivasan.T

    I have upgraded to the version mentioned by you. Even now it is not getting upgraded. I am exporting data using Excel sheet only. Is it possible for you to explain how to migrate data thru SQL * PLUS?
    Thanks,
    Srinivasan.T

Maybe you are looking for

  • How to delete hidden security copies of Time Machine?

    I had the same issue with Mavericks & Lion, the OS starts making by his own a hidden security copy without using Time Machine on my local disk, usually I used the next command on terminal and my problem would be deleted "sudo tmutil disablelocal" but

  • NEED HELP ON HOW TO TURN STATUS BAR OF A JSF PAGE OFF

    I need a pop-up within my application where a staff can select his HOD(An hyperlink named HODNAME with text SELECT ) and on click it shows a pop up of a page (allstafflist.jsp) which has table and contains all staff. It has Select link which return n

  • Array of Object

    How to create array of object dynamically and the class is also having constructor. like: class Cir{ private double radius; Cir(double r){ redius=r; 10 objects are to be created within for loop

  • How can I reset the settings of one Yosemite Account?

    Hello. How can I reset the dock, preferences, etc. of only ONE Yosemite Account instead of the whole computer. Yes, I know that I can just make a new account, but I don't really want to do that. Please help.

  • CLM Mail MIME Type Issue

    Users are entering special characters in the instructions to the signatory, and when the string is picked up into the custom email, the system is mis-translating the characters in the CLM.We suspect on the custom java mail util not setting up the MIM