convert BYTE CHAR

Hello
on the 11g R2,.

If a Column1 is VARCHAR2 (20 byte) and column2 is VARCHAR2(20 char), which needs more disk space to be stored (let's assume we have just one line)?

We are in non-unicode mode.

If I MYTABLE (column1 VARCHAR2 (20 byte)) how can I convert to MYTABLE (column1 VARCHAR2 (20 CHAR))?

Thank you.

user522961 wrote:
Thank you all.
I wanted to understand the reason for the parameter NLS_LENGTH_SEMANTICS to CHAR

As already explained more high semantic length is designed to define the size of a column in the table so that you do not get the error of allocation of space in the column of table such as:

 oerr ora 12899
12899, 00000, "value too large for column %s (actual: %s, maximum: %s)"
// *Cause: An attempt was made to insert or update a column with a value
//         which is too wide for the width of the destination column.
//         The name of the column is given, along with the actual width
//         of the value, and the maximum allowed width of the column.
//         Note that widths are reported in characters if character length
//         semantics are in effect for the column, otherwise widths are
//         reported in bytes.
// *Action: Examine the SQL statement for correctness.  Check source
//          and destination column data types.
//          Either make the destination column wider, or use a subset
//          of the source column (i.e. use substring).

If your application requires it, you do it because it is so dependent on the application.

Here's a long discussion on the pros and cons of the parameter NLS_LENGTH_SEMANTICS to CHAR: Re: language support of several

Tags: Database

Similar Questions

  • Convert byte [] to bitmap

    How convert byte [] bitmap and convert bitmap to byte [] image and when to get the image of the server back to a string how to parse this string for byte [] exmple in android it parse like that

    byte[] logoImg = Base64.decode(jLogo.getString(i), 0);
    

    Thanks in advance

    Hello

    You can use the method createBitmapFromBytes of the Bitmap class to convert an array of bytes to a Bitmap image. If you know that the image will be in PNG format you can even use createBitmapFromPNG

    Specification of the API:

    http://www.BlackBerry.com/developers/docs/7.0.0api/NET/rim/device/API/system/bitmap.html#createBitma...

    http://www.BlackBerry.com/developers/docs/7.0.0api/NET/rim/device/API/system/bitmap.html#createBitma...

  • Help me convert (BYTE) V2 to V2 (Char)

    Hello!
    Please, help me! I have already created several tables that have fields with Varchar2 parameter. Because
    Basically, there is Varchar2 (BYTE) parameters, fields created as Varchar2 (BYTE). I have the UTF-8 encoding used in
    database. Whereas now, I started to think that 1 tank in UTF not = 1 byte. So, how can I convert all fields
    with Varchar2 (Byte) to Varchar2 (TANK)? It is very important to me, now I know that. There are many tables,
    in order to edit a lot of time having conducted manually, but create new I can not, because many of the tables is now used :(

    Thank you!

    As I said in my first post, you need a LOG table and an exception block, then an outer join to exclude those who have already succeeded

    something like that;

    create table log_tbl (
      table_name varchar2(30)
    , column_name varchar2(30)
    , msg varchar2(200)
    , error_flag varchar2(1) default 'P') -- P for Pass and F for Fail.
    /
    
    SQL> select table_name, column_name, char_used
      2  from user_tab_columns
      3  where table_name in ('T1','T2')
      4  /
    
    TABLE_NAME                     COLUMN_NAME                    C
    ------------------------------ ------------------------------ -
    T1                             A                              B
    T2                             A                              B
    
    SQL> declare
      2    l_Err varchar2(200);
      3  begin
      4    for r in (select  atc.table_name, atc.column_name, atc.data_length
      5              from    user_tab_columns atc -- You would probably use ALL_
      6              left outer join Log_Tbl lt on (atc.Table_name   = lt.Table_Name
      7                                         and atc.Column_name = lt.Column_Name
      8                                         and lt.Error_Flag   = 'P')
      9              where   atc.data_type   = 'VARCHAR2'
     10              and     atc.char_used   = 'B'
     11              and     atc.Table_Name in ('T1', 'T2', 'T3')) loop
     12
     13      begin
     14        execute immediate 'alter table ' || r.table_name
     15                                        || ' modify '
     16                                        || r.column_name
     17                                        || ' varchar2('
     18                                        || r.data_length
     19                                        || ' char)';
     20
     21        insert into Log_tbl (Table_Name, Column_Name)
     22        values  (r.Table_Name, r.Column_Name);
     23
     24        exception
     25          when others then
     26            l_Err := sqlerrm;
     27            insert into Log_tbl (Table_Name, Column_Name, Msg, Error_Flag)
     28            values  (r.Table_Name, r.Column_Name, l_Err, 'F');
     29      end;
     30
     31      commit;
     32
     33    end loop;
     34
     35  end;
     36  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select table_name, column_name, char_used
      2  from user_tab_columns
      3  where table_name in ('T1','T2', 'T3')
      4  /
    
    TABLE_NAME                     COLUMN_NAME                    C
    ------------------------------ ------------------------------ -
    T1                             A                              C
    T2                             A                              C
    
    SQL> select table_name,column_name,error_flag
      2  from log_tbl;
    
    TABLE_NAME      COLUMN_NAME     E
    --------------- --------------- -
    T1              A               P
    T2              A               P
    
    SQL> create table t3 (a varchar2(20) )
      2  /
    
    Table created.
    
    SQL> insert into t3 (a) values ('Hello')
      2  /
    
    1 row created.
    
    SQL> declare
      2    l_Err varchar2(200);
      3  begin
      4    for r in (select  atc.table_name, atc.column_name, atc.data_length
      5              from    user_tab_columns atc -- You would probably use ALL_
      6              left outer join Log_Tbl lt on (atc.Table_name   = lt.Table_Name
      7                                         and atc.Column_name = lt.Column_Name
      8                                         and lt.Error_Flag   = 'P')
      9              where   atc.data_type   = 'VARCHAR2'
     10              and     atc.char_used   = 'B'
     11              and     atc.Table_Name in ('T1', 'T2', 'T3')) loop
     12
     13      begin
     14        execute immediate 'alter table ' || r.table_name
     15                                        || ' modify '
     16                                        || r.column_name
     17                                        || ' varchar2('
     18                                        || r.data_length
     19                                        || ' char)';
     20
     21        insert into Log_tbl (Table_Name, Column_Name)
     22        values  (r.Table_Name, r.Column_Name);
     23
     24        exception
     25          when others then
     26            l_Err := sqlerrm;
     27            insert into Log_tbl (Table_Name, Column_Name, Msg, Error_Flag)
     28            values  (r.Table_Name, r.Column_Name, l_Err, 'F');
     29      end;
     30
     31      commit;
     32
     33    end loop;
     34
     35  end;
     36  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select table_name, column_name, char_used
      2  from user_tab_columns
      3  where table_name in ('T1','T2', 'T3')
      4  /
    
    TABLE_NAME      COLUMN_NAME     C
    --------------- --------------- -
    T1              A               C
    T2              A               C
    T3              A               C
    
  • How to convert byte [] EncodedImage rgb565 or bitmap data

    Hi all I am playing a video and I want to get snapshot of video as

    Byte [] byteArr = videoControl.getSnapshot ("encoding = rgb565");

    I try to get the Bitmap as

    image = EncodedImage.createEncodedImage (byteArr, 0, byteArr.length);

    image bitmap = image.getBitmap ();

    but she throws an Exception as IllegalArgumentException.

    I get a table of double length than screenWidth * ScreenHeight, perhaps because of the rgb565

    How can I convert a byte [] bitmap.

    I solve the problem to get the bitmap by building as

    image bitmap = new Bitmap (Bitmap.ROWWISE_16BIT_COLOR, Graphics.getScreenWidth (), Graphics.getScreenHeight (), byteArr);

  • convert bytes MB with PHP getSize

    I thought I had cracked the nut of a previous debate.

    http://forums.Adobe.com/message/4741283#4741283

    A file works fine on my local test server.  But on the remote site, the results are an unsorted mess.

    I found a script that handles this pretty well.

    <? PHP

    class SortingIterator implements IteratorAggregate

    {

    private $iterator = null;

    public function __construct (Traversable $iterator, $callback)

    {

    If (! is_callable ($callback)) {}

    throw new InvalidArgumentException ("given callback is not callable!'");

    }

    $array = iterator_to_array ($iterator);

    usort ($array, $callback);

    $this-> iterator = new ArrayIterator ($array);

    }

    public void getIterator()

    {

    Return $this-> iterator;

    }

    }

    ? >

    <! - results - >

    < ul >

    <? PHP

    function mysort ($a, $b)

    {

    return $a-> getPathname() > $b-> getPathname().

    }

    $it = new SortingIterator (new RecursiveIteratorIterator (new RecursiveDirectoryIterator ("PATH/MY_DIRECTORY'")), "mysort");

    {foreach ($it as $file)

    echo "" < li > < a href = "". $file. « « > ». $file-> getFilename(). "< /a > -". $file-> getSize().' bytes < /li > ';

    }

    ? >

    < /ul >

    All I need now is a simple way to convert results getSize bytes in MB.

    Any ideas?

    Thank you

    Nancy O.

    Use the round() php function

    http://www.php.net/manual/en/function.round.php

    round (file-> getSize() / 1048576, 2)

  • DATA_LENGTH in all_tab_columns in BYTES/CHAR?

    Hello

    in Oracle 11 g 2 or 10 gr 2 documentation, you will find the following description of ALL_TAB_COLUMNS. DATA_LENGTH.
    DATA_LENGTH      NUMBER      NOT NULL      Length of the column (*in bytes*)
    But what of VARCHAR2 fields that were created with
    NLS_LENGTH_SEMANTICS='CHAR'
    My observation is that in 10g ALL_TAB_COLUMNS. DATA_LENGTH indicates the length in mode what ever, that you have created the table. So if I created a VARCHAR2 as VARCHAR2 (4 CHAR) field, then ALL_TAB_COLUMNS. DATA_LENGTH indicates 4. 11 g however the field really shows the length in bytes. So I could observe data_length = 16 for a field that has been defined as VARCHAR2 (4 CHAR) on a database of 11 GR 2 with NLS_CHARACTERSET = "AL32UTF8.

    Is there an opposite observation or experience?

    FYI - compare and contrast with char_length and char_used columns.

  • Read byte/char from socket inputstream

    Hey fellow coders.
    I ran into a bit of coding of a http client drive problem for my assignment. I created a simple program that opens a connection with a server and the request for a file to download. The socket inputstream is encapsulated in a bufferedreader and I can successfully retrieve the response of the full text of the server via the player. Unfortunately, every time I download an mp3 file, the data is corrupted. The problem lies in the fact that bufferedreader decodes the stream of bytes into a string with the utf8. I can't use the underlying socket inputstream as bufferedreader has already read before in and perhaps spent the beginning of the content area. Analysis of the chain with getBytes ("UTF 8") does not work that the audio file is damaged.
    My question is, is there any player that can send me data from a stream unique both as char or byte? Everyone fell on this problem and found a solution for it?

    Thank you.

    The socket inputstream is encapsulated in a bufferedreader

    Why?

    and I can successfully retrieve the response of the full text of the server via the player.

    Why is the server sends a response text followed by binary data?

    In this circumstance, I would use DataInputStream.readLine (), despite his disapproval, followed to call read() to get binary bytes.

  • Convert Date CHAR

    Hello friends,

    I have the Date in the database in the following format:

    2008-06-16 17:51:58.030

    I need to convert this date format in CHAR format and make it look like:

    2008-06-16 (it should be CHAR and no DATE so I can't use the custom level of response format)
    JJ/MM/AAAA

    Thank you
    Saurabh

    Hello

    Yes I tried to give space and then write the following code

    TRIM (TRIM (cast (dayofmonth (Times." ((("The time Id ') as float)) | » /'|| TRIM (cast (month (Times.")) ((("The time Id ') as float)) | » /'|| TRIM (cast (year (Times.") (((("The time Id ') as char)))

    It works

    Concerning

    NGO

  • Command to change the semantics BYTE char to a table column

    DB version: 10 gr 2

    I know that he is an ALTER TABLE TableName CHANGE command to change the NLS_LENGTH_SEMANTICS for a table column.

    I need to change column of the table EMP of Ename and TANK job. How can I do this with an ALTER command?
    SQL>col data_Type format a12
    SQL>col column_name format a10
    SQL>
    SQL>select COLUMN_NAME, DATA_TYPE,DATA_LENGTH, CHAR_LENGTH,CHAR_USED
      2  from dba_tab_columns
      3  where table_name='EMP' and owner = 'SCOTT';
    
    COLUMN_NAM DATA_TYPE    DATA_LENGTH CHAR_LENGTH C
    ---------- ------------ ----------- ----------- -
    EMPNO      NUMBER                22           0
    ENAME      VARCHAR2              10          10 B
    JOB        VARCHAR2               9           9 B
    MGR        NUMBER                22           0
    HIREDATE   DATE                   7           0
    SAL        NUMBER                22           0
    COMM       NUMBER                22           0
    DEPTNO     NUMBER                22           0
    
    8 rows selected.

    Try

    alter table emp modify (ename varchar2(10 char), job varchar2(9 char));
    
  • How to convert a CHAR to NUMBER?

    I have a pl/sql statement that filters the information in the report. I end up getting the error:

    ORA-06502: PL/SQL: digital or value error: character of number conversion error

    If I select the area of selection of time waiting with a value and then enter a value for each exercise, start date, end date, or search report, it returns the correct information. But if I enter a value for the exercise, start date, end date or report first searches, it returns the above error.

    In the database wait_time is a NUMBER.

    Can someone help me please? Thank you!


    DECLARE
    FISCAL_YR VARCHAR2 (4);
    Q VARCHAR2 (4000);
    BEGIN
    q: = ' select * from
    (SELECT
    DATETIME,
    COUNTY_ABBR,
    WAIT_TIME,
    CONT_SERVICE,
    State,
    COMMENTS,
    BEG_DATE,
    END_DATE
    OF MOTOR_ASSIST2)
    WHERE
    (
    InStr (upper ("DATETIME"), upper (nvl (: P10_REPORT_SEARCH, "DATETIME"))) > 0 or
    InStr (upper ("COUNTY_ABBR"), upper (nvl (: P10_REPORT_SEARCH, "COUNTY_ABBR"))) > 0 or
    InStr (upper ("wait_time"), upper (nvl (: P10_REPORT_SEARCH, "Wait_time"))) > 0 or
    InStr (upper ("CONT_SERVICE"), upper (nvl (: P10_REPORT_SEARCH, "CONT_SERVICE"))) > 0 or
    InStr (upper ("STATE"), upper (nvl (: P10_REPORT_SEARCH, "STATE"))) > 0 OR
    InStr (upper ("COMMENTS"), upper (nvl (: P10_REPORT_SEARCH, "COMMENTS"))) > 0)';

    -Start and end Date filter
    If: P10_BEG_DATE is not null and: P10_END_DATE is not null then
    q : = q || ' and
    TO_CHAR (DATETIME, ' YYYYMMDD ") BETWEEN
    TO_CHAR (to_date (: P10_BEG_DATE, ' MM/DD/YYYY HH: mi ""), "YYYYMMDD") AND
    TO_CHAR (to_date (: P10_END_DATE, ' MM/DD/YYYY HH: mi ""), "YYYYMMDD")';
    end if;


    -Filter exercise
    If: P10_filter_fy is not null THEN
    q : = q || ' and
    : p10_filter_fy = TO_CHAR (ADD_MONTHS(DATETIME,6), "YYYY")';
    end if;

    -Filter the waiting time in Minutes between 0 and 10
    If: p10_filter_wait_time is not null and: p10_filter_wait_time between 0 and 10 can
    q : = q || ' and
    To_char (wait_time) between 0 and 10';
    end if;

    -Filter the waiting time in Minutes between 11 and 20
    If: p10_filter_wait_time is not null and: p10_filter_wait_time between 11 and 20 then
    q : = q || ' and
    To_char (wait_time) between 11 and 20';
    end if;

    -Filter the waiting time in Minutes between 21 and 30
    If: p10_filter_wait_time is not null and: p10_filter_wait_time between 21 and 30, then
    q : = q || ' and
    To_char (wait_time) between 21 and 30';
    end if;

    -Filter the waiting time in Minutes between 31 and 40
    If: p10_filter_wait_time is not null and: p10_filter_wait_time between 31 and 40 and then
    q : = q || ' and
    To_char (wait_time) between 31 and 40';
    end if;

    -Filter the waiting time in Minutes between 41 and 50
    If: p10_filter_wait_time is not null and: p10_filter_wait_time between 41 and 50 then
    q : = q || ' and
    To_char (wait_time) between 41 and 50';
    end if;

    -Filter the waiting time in Minutes between 51 and 60
    If: p10_filter_wait_time is not null and: p10_filter_wait_time between 51 and 60 then
    q : = q || ' and
    To_char (wait_time) between 51 and 60';
    end if;

    -Filter of time-out in Minutes over 60 years
    If: p10_filter_wait_time is not null and: p10_filter_wait_time between 61 and 1000 then
    q : = q || ' and
    To_char (wait_time) between 61 and 1000';
    end if;

    RETURN Q;
    END;


    Deanna

    Deanna,

    You may need to remove wait_time to_char, because it is a numeric value.

    Also, I would like to remove:

    if :p10_filter_wait_time is not null and :p10_filter_wait_time between 0 and 10 then
    q :=q || ' and
    TO_CHAR(wait_time) between 0 and 10';
    end if;
    
    ---Filter Wait Time in Minutes between 11 and 20
    if :p10_filter_wait_time is not null and :p10_filter_wait_time between 11 and 20 then
    q :=q || ' and
    TO_CHAR(wait_time) between 11 and 20';
    end if;
    
    ---Filter Wait Time in Minutes between 21 and 30
    if :p10_filter_wait_time is not null and :p10_filter_wait_time between 21 and 30 then
    q :=q || ' and
    TO_CHAR(wait_time) between 21 and 30';
    end if;
    
    ---Filter Wait Time in Minutes between 31 and 40
    if :p10_filter_wait_time is not null and :p10_filter_wait_time between 31 and 40 then
    q :=q || ' and
    TO_CHAR(wait_time) between 31 and 40';
    end if;
    
    ---Filter Wait Time in Minutes between 41 and 50
    if :p10_filter_wait_time is not null and :p10_filter_wait_time between 41 and 50 then
    q :=q || ' and
    TO_CHAR(wait_time) between 41 and 50';
    end if;
    
    ---Filter Wait Time in Minutes between 51 and 60
    if :p10_filter_wait_time is not null and :p10_filter_wait_time between 51 and 60 then
    q :=q || ' and
    TO_CHAR(wait_time) between 51 and 60';
    end if;
    
    ---Filter Wait Time in Minutes over 60
    if :p10_filter_wait_time is not null and :p10_filter_wait_time between 61 and 1000 then
    q :=q || ' and
    TO_CHAR(wait_time) between 61 and 1000';
    end if;
    

    for something like:

    if :p10_filter_wait_time is not null then
    q :=q || ' and ' || to_interval(wait_time);
    end if;
    

    to_interval function encapsulates all the logic you will need.

    Tip:

    1. Please use the code tags (delimited by ' {' and '}').

    Kind regards

    Published by: Walter Fernandez on November 4, 2008 15:14

  • How to convert an array of char byte array?

    Hello

    Someone can say, how can I convert Byte char []?

    Thank you

    What:

    data Byte [] =...

    Char [] charArr = (new String (data)) .toCharArray ();

    Rab

  • Convert InputStream into byte array

    Hey everybody,

    I really need help with this problem that I can not get rid! I am doing an application that loads an image saved on the BB device and sends it to a server, the problem is we can send only a byte [].

    So I try to apply the following method:

    -Loading the image via the FileConnection class

    -Open an InputStream from the FileConnection said

    -Convert an array of bytes as InputStream

    The code should look like this I guess:

    FileConnection file = (FileConnection) Connector.open ("Original_SealV.jpg");
    InputStream is = file.openInputStream ();

    Byte [] img = null;
    int temp = is.read ();
    {while(Temp>0)}

    Convert bytes here?

    }

    This is the last step I'm missing, I tried several methods, but could not run, so I beg for a bit of the collective wisdom of these forums...

    Could someone help me? I will not forget the congratulations!

    or you can always use the standard API

    Byte [] buf = IOUtilities.streamToBytes (stream);

  • Byte [] convert bitmap in OS 5.0

    I want to convert byte [] bitmap in OS 5.0

    Please someone help me

    Hi @ahmednaserfinal

    See this link:

    http://www.BlackBerry.com/developers/docs/5.0.0api/NET/rim/device/API/system/bitmap.html#createBitma...

    E.

  • Convert size in bytes in human readable size unit

    11.2.0.2 RDBMS

    Hi all

    Is there any function on Oracle to convert bytes into human readable?

    Give a number in bytes, that this number is converted in kilobytes or megabytes the gigabytes and so on.

    Thank you guys.

    CREATE THE FUNCTION HDATA_SIZE)

    p_bytes in NUMBERS

    p_decimal IN DEFAULT NUMBER 0)

    RETURN VARCHAR2

    AS

    HBYTES VARCHAR2 (80);

    BEGIN

    HBYTES: = BOX

    WHEN p_bytes BETWEEN 0 AND 1023 CAN p_bytes | "Bytes

    WHEN p_bytes< power(1024,2)="" then="" round(p_bytes="" 1024,p_decimal)="" ||'="">

    WHEN p_bytes< power(1024,3)="" then="" round(p_bytes="" power(1024,2),p_decimal)="" ||'="">

    WHEN p_bytes< power(1024,4)="" then="" round(p_bytes="" power(1024,3),p_decimal)="" ||'="">

    WHEN p_bytes< power(1024,5)="" then="" round(p_bytes="" power(1024,4),p_decimal)="" ||'="">

    WHEN p_bytes< power(1024,6)="" then="" round(p_bytes="" power(1024,5),p_decimal)="" ||'="">

    WHEN p_bytes< power(1024,7)="" then="" round(p_bytes="" power(1024,6),p_decimal)="" ||'="">

    WHEN p_bytes< power(1024,8)="" then="" round(p_bytes="" power(1024,7),p_decimal)="" ||'="">

    WHEN p_bytes< power(1024,9)="" then="" round(p_bytes="" power(1024,8),p_decimal)="" ||'="">

    ON THE OTHER

    "Invalid value for bytes.

    END;

    RETURN HBYTES;

    END;

    SELECT BYTES,

    CASE

    WHEN BETWEEN 0 AND 1023 BYTES CAN p_bytes | "Bytes

    WHEN BYTES< power(1024,2)="" then="" round(bytes="" 1024,2)="" ||'="">

    WHEN BYTES< power(1024,3)="" then="" round(bytes="" power(1024,2),2)="" ||'="">

    WHEN BYTES< power(1024,4)="" then="" round(bytes="" power(1024,3),2)="" ||'="">

    WHEN BYTES< power(1024,5)="" then="" round(bytes="" power(1024,4),2)="" ||'="">

    WHEN BYTES< power(1024,6)="" then="" round(bytes="" power(1024,5),2)="" ||'="">

    WHEN BYTES< power(1024,7)="" then="" round(bytes="" power(1024,6),2)="" ||'="">

    WHEN BYTES< power(1024,8)="" then="" round(bytes="" power(1024,7),2)="" ||'="">

    WHEN BYTES< power(1024,9)="" then="" round(bytes="" power(1024,8),2)="" ||'="">

    ON THE OTHER

    "Invalid value for bytes.

    END;

    HUMAN_SIZE,

    HDATA_SIZE (BYTES) FUNC_BYTES,

    HDATA_SIZE(BYTES,2) FUNC_BYTES_ROUND_2

    OF BYTES_CONVERSION;

    "BYTES." 'HUMAN_SIZE '. 'FUNC_BYTES '. 'FUNC_BYTES_ROUND_2 '.
    48743068764242424 "43,29 PB" "PB 43. "43,29 PB"
    2052456451442442 "PB OF 1.82. "2 PB. "PB OF 1.82.
    1456842042452424 "PB OF 1.29. "1 PB. "PB OF 1.29.
    140018974724255 "127,35 TB" "127 TB" "127,35 TB"
    1380345446444 "1.26 TB" "1 TB. "1.26 TB"
    11682705691 "10,88 GB" "11-GO" "10,88 GB"
    9419054298 "8,77 GB" '9 GB' "8,77 GB"
    4928925707 "4.59 GB" "5 GB" "4.59 GB"
    4734365808 "4.41 GB" "4 GB" "4.41 GB"
    2996172607 "2.79 GB" "3 GB" "2.79 GB"
    2996161255 "2.79 GB" "3 GB" "2.79 GB"
    2239299702 "2.09 GB" "2 GB" "2.09 GB"
    2239294829 "2.09 GB" "2 GB" "2.09 GB"
    1092878347 "1.02 GB" "1 GB". "1.02 GB"
    1034780683 "986,84 MB" "987 MB" "986,84 MB"
    902561803 "860,75 MB" "861 MB" "860,75 MB"
    710223170 "677,32 MB" "677 MB" "677,32 MB"
    700729988 "668,27 MB" "668 MB" "668,27 MB"
    700598916 "668,14 MB" "668 MB" "668,14 MB"
    631504907 "602,25 MB" "602 MB" "602,25 MB"

    Editada por Mensagem: bytes-13728488

  • Convert number to char

    Hello

    I need to format numbers when converted to char.
    I need to show the number with a precision of 3 and when between-1 and 1 to show the value 0.

    ex:
    0.234
    -0.234
    1.220

    not de.234

    Thanks in advance

    I need to show the number with a precision of 3 and when between-1 and 1 to show the value 0.

    This?

    SQL> with t as (
     select 0.234 n from dual union all
     select -0.234 from dual union all
     select  13.22 from dual union all
     select 1.220 from dual
    )
    --
    --
    select n, to_char(n, '990.000')  n2 from t
    /
             N N2
    ---------- --------
          ,234    0.234
        -0,234   -0.234
         13,22   13.220
          1,22    1.220
    
    4 rows selected.
    

Maybe you are looking for