Size in bytes of each datatype?

Hi
Im a spanish user of oracle 9i. I want to know what is the size of each datatype in Oracle 9i.Ie, how many bytes is a float?, or a date? or a varchar2(20)?
I have been searching in this website, but I did not find anything.
Regards,
Antonio

Use the good old "let's put my hands on this" approach:TEST> create table test_number
  2  (
  3  a number(1),
  4  b number(2),
  5  c number(3),
  6  d number(38)
  7  );
Table created.
TEST> insert into test_number
  2  values
  3  (1,11,111,to_number(rpad('9',38,'9')));
1 row created.
TEST> insert into test_number
  2  values
  3  (1,1,11,to_number(rpad('9',15,'9')));
1 row created.
TEST> COMMIT;
Commit complete.
TEST> select vsize(A),vsize(B),vsize(C), vsize(D) from test_number;
  VSIZE(A)   VSIZE(B)   VSIZE(C)   VSIZE(D)
         2          2          3         20
         2          2          2          9
TEST> truncate table test_number;
Table truncated.
TEST> alter table test_number modify (D NUMBER(38,5));
Table altered.
TEST> insert into test_number
  2  values
  3  (1,11,111,to_number(rpad('9',33,'9')));
1 row created.
TEST> insert into test_number
  2  values
  3  (1,11,111,to_number(rpad('9',33,'9') || ',99'));
1 row created.
TEST> insert into test_number
  2  values
  3  (1,11,111,to_number(rpad('9',33,'9') || ',99999'));
1 row created.
TEST> COMMIT;
Commit complete.
TEST> select vsize(A),vsize(B),vsize(C), vsize(D) from test_number;
  VSIZE(A)   VSIZE(B)   VSIZE(C)   VSIZE(D)
         2          2          3         18
         2          2          3         19
         2          2          3         21Yoann.

Similar Messages

  • Programatically, Can I determine the size in bytes of each page of a pdf  using C++ and Acrobat X?

    Hi,
    I need to create an MFC application to open a pdf and get the size of each page in Bytes.
    Is it possible???
    I am really appreciate to your help. Thanks

    Hi,
    An example of what I want to do is to open a pdf whose size is 20 MB and split it into several pdfs with a maximum size of 10 MB.
    The idea is to open the pdf of 20 MB and go getting the size of the pages to see how many I can include in each new pdf..
    Thanks

  • How to get folder size in bytes

    Hi all,
    Is there a easy way to get folder size in bytes?  I don't want to check each file in it and then add them up.
    Thanks for any help.
    Anne

    Years ago, I found my home PC was lacking disk space and could not exaplain where all of the space went.
    At the same time I was teaching myslef how to use the Picture control and Windows did not allow you to check the size of a folder and it sub-folders. So I used that situation to learn about the picture control and LV at the same time.
    It worked and ran but very slowly.
    Soon after Greg McKaskle was putting together the first version of "The Good The Bad and The Ugly" and was looking for fodder to beat up. I offered and he accepted. When the time came for the presentation, my code was chosen as "The bad" since I had not learned how to do a cluster sort at that time so I wrote my own version of a bubble sort (the VI presents a Pie Chart of disk usage and clcik on the sectors of the Pie Chart allowed you to drill down so I hd to sort by sizes).
    So why am I telling you this long boring story?
    That code is attached for you to look at laugh and tell me how dumb I was.
    Feel free to beat me up. It can't be any worse than the abuse I got from Greg (I felt like I was being raped).
    Have fun!
    Ben
    Code is probably 6 or thereabouts. "Disk_Utility" is top level. Remember this is an example of how NOT to code.
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    DIsk_Pie_Utility.zip ‏162 KB

  • How to get the file size (in bytes) for all files in a directory?

    How to get the file size (in bytes) for all files in a directory?
    The following code does not work. isFile() does NOT recognize files as files but only as directories. Why?
    Furthermore the size is not retrieved correctly.
    How do I have to code it otherwise? Is there a way of not converting f-to-string-to-File again but iterate over all file objects instead?
    Thank you
    Peter
    java.io.File f = new java.io.File("D:/todo/");
    files = f.list();
    for (int i = 0; i < files.length; i++) {
    System.out.println("fn=" + files);
    if (new File(files[i]).isFile())
         System.out.println("file[" + i + "]=" + files[i] + " size=" + (new File(files[i])).length() ); }

    pstein wrote:
    ...The following code does not work. Work?! It does not even compile! Please consider posting code in the form of an SSCCE in future.
    Here is an SSCCE.
    import java.io.File;
    class ListFiles {
        public static void main(String[] args) {
            java.io.File f = new java.io.File("/media/disk");
            // provides only the file names, not the path/name!
            //String[] files = f.list();
            File[] files = f.listFiles();
            for (int i = 0; i < files.length; i++) {
                System.out.println("fn=" + files);
    if (files[i].isFile()) {
    System.out.println(
    "file[" +
    i +
    "]=" +
    files[i] +
    " size=" +
    (files[i]).length() );
    }Edit 1:
    Also, in future, when posting code, code snippets, HTML/XML or input/output, please use the code tags to retain the indentation and formatting.   To do that, select the code and click the CODE button seen on the Plain Text tab of the message posting form.  It took me longer to clean up that code and turn it into an SSCCE, than it took to +solve the problem.+
    Edited by: AndrewThompson64 on Jul 21, 2009 8:47 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Limit size (in byte) of SELECT-OPTIONS in WHERE clauses

    hi,
    as far as I know there is a limit size (in byte) for SELECT-OPTIONS used in WHERE clauses. Is it true? What is the limit? If the SELECT-OPTIONS is based on lifnr (character type, 10 long) is the following calculation valid?
    sign - 1 byte
    option - 2 bytes
    low - 10 bytes
    high - 10 bytes
    23 bytes all together for one line, is this valid?
    thanks
    ec

    Hi,
    Check this link..
    https://forums.sdn.sap.com/click.jspa?searchID=6896082&messageID=2891787
    Regards,
    Omkar.

  • Determination of array size in bytes

    Dear forum users,
    I want to determine the size of an array subset in bytes.
    At the moment I try to do this as shown in my attached program: Simply said, I am reading in my data (example data can also be found in the attachment) and convert them into an array. From this array I am taking the subset I am interested in. This array subset is saved in a new file from which I determine the byte size with the “Get File Size.vi”.
    That are a lot of steps with file saving (deletion of the compulsory created new file not mentioned) just to get the byte size of this array subset.  And with this approach the file size (the byte size of my array subset) is unfortunately depending on the format with which I save the file (%.6f or similar), but I would need the byte size of this subarray as it would be in the original file (see my comment on the front panel).
    Therefore, I want to know if there is a better, simpler, quicker and correct way to get the byte size of a subarray.
    I would be very happy about every comment and help!
    Attachments:
    ByteSizeOfArraySubsetLV2011.vi ‏18 KB
    ByteSizeOfArraySubsetLV8_6.vi ‏15 KB
    ExampleData.txt ‏1114 KB

    Dear GerdW and smercurio_fc,
    Thanks a lot for your replies! Perhaps I should have mentioned that I need the size of my array (string…, I am confused now) in bytes because I want to use later in my program the “Set File Position.vi” (which needs an offset in bytes). With this vi I want to read in my data again but starting after the data which I have used in my array (I try to make bunches out of my file).
    Ok, the suggestion of GergW is a step forward, but it does not work correctly. I have modified my program a bit (see attachment), so that it gives back the file size of the original file and the length of the string after the file has been read in. Interestingly, the numbers are not the same. The same is also true for my subarray (and the string length is still dependent on the format with which I convert my array to a string).
    So once again asked: If I take from my original file lines 3 to 12, copy them in a new file and save this file, then I can read out the size of the file (191 bytes). How can I get the same number in LabVIEW after reading in the original file and taking the same subarray? I hope my question is clearer now (it is surely suffering a bit from my bad English. I am sorry!).
    I hope to hear from you again!
    Attachments:
    ByteSizeOfArraySubsetLV2011_2.vi ‏14 KB
    ByteSizeOfArraySubsetLV8_6_2.vi ‏11 KB

  • How to get image size in bytes

    i have to get image size in bytes and accessing image from the a folder
    Thanks in advance

    If it's going to be accessed as a file on the filesystem, you can use java.io.File.length() to get the size in bytes.
    In other situations...it depends on what you're doing.

  • Calculate the size(in bytes) that will be displayed to the console by command Write-Output

    Is there some way to check the size(in bytes) of the output that will be displayed to the console using Write-Output command. I want the console to display only the first 1024 bytes of the objects output.

    Hi Sachin,
    in that case let me add an example on how to read content from a file that may be or may not be a text file:
    $string = [System.Text.Encoding]::UTF8.GetString([System.IO.File]::ReadAllBytes("D:\example.txt"))
    Theoretically, the "Get-Content" cmdlet ought to do the same, however I have occasionally experienced different results.
    You can choose to not convert it to string and just print the bytes too (or choose another encoding of your preference). Remember, a single letter usually uses 2 bytes, thus reading the first 1024 bytes from a file you converted to text would mean printing
    the first 512 letters.
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • Cluster size in bytes programatically

    Is there something that implements a C stype "sizeof" in labview? I need to call a dll and pass in a cluster value and it's size in bytes.
    Thanks
    Eugene

    If the cluster doesn't have variable length data (strings and arrays), flatten the cluster to string and get the string length.
    LabVIEW, C'est LabVIEW

  • Error:  Debug Component exceeds maximum size (65535 bytes)

    Hi All,
    It would seem that I have come across a limitation in the CAP file format for Java Card 2.2.1. When I run the Sun 2.2.1 converter I get the following output:
    Converting oncard package
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    error:  Debug Component exceeds maximum size (65535 bytes).
    Cap file generation failed.
    conversion completed with 1 errors and 0 warnings.This also happens with JCDK 2.2.2. Is there any way around this limitation? I can instruct the compiler to not generate some of the debug output such as variable attributes, but this makes the debugger less than useful. I could not find anything in the JCVM spec for JC2.2.1 that mentions this limitation (I could have missed it very easily if it is there). Is this a limitation that will be lifted in new versions of the standard? This is tarting to be a bit of a problem as our code base has outgrown our development tools (no more debugger). Compiling and running without debug information works fine.
    Any information on this would be much appreciated.
    Cheers,
    Shane

    For those that are interested, I found this in the Java Card VM spec. u1 and u2 are 1 and 2 byte unsigned values respectively. It would appear that it is a limitation of the CAP file format. We have managed to work around this problem (parsing the debug component of the cap file was very informative) by shortening package names, reducing exception handling, and removing classes that we could do without.
    It looks like this is removed for JC3.0 Connected Edition does not have this issue as it does not have CAP files, but JC2.2.2 and JC3.0 Classic Edition have this same issue. It would be nice if there was a converter/debugger combination that removed this limitation. If anyone knows of such a combination, I am all ears! I know for a fact that JCOP does not :(
    Cheers,
    Shane
    *6.14 Debug Component*
    This section specifies the format for the Debug Component. The Debug Component contains all the metadata necessary for debugging a package on a suitably instrumented Java Card virtual machine. It is not required for executing Java Card programs in a non-debug environment.
    The Debug Component references the Class Component (Section 6.8 "Class Component”), Method Component (Section 6.9 "Method Component”), and Static Field Component (Section 6.10 "Static Field Component”). No components reference the Debug Component.
    The Debug Component is represented by the following structure:
    {code}
    debug_component {
    u1 tag
    u2 size
    u2 string_count
    utf8_info strings_table[string_count]
    u2 package_name_index
    u2 class_count
    class_debug_info classes[class_count]
    {code}
    The items in the debug_component structure are defined as follows:
    *tag* tag item has the value COMPONENT_Debug (12).
    *size* The number of bytes in the component, excluding the tag and size items. The value of size must be greater than zero.

  • How do I convert an array of BYTES (where each BYTE represents a bit) into a single Hex number?

    I am reading a signal from a USB-8451. This signal is stored as an array where each element represents a bit in the signal, but is stored in the array as a byte. How do I convert this array into a single Hex number. I attatched what I have so far, there are a few extra things to help me see what ia going on. One code uses Queue and the other uses arrays, let me know if you can help.
    Attachments:
    845x_EEPROMarrays.vi ‏27 KB
    845x_EEPROM.vi ‏26 KB

    mkssnwbrd wrote:
    ... so we can't introduce any other forms of signals or power into the circuit other than what the circuit already has. Trithfully I don't really know how I2C devices work, but my mentor here says that we can't use an I2C method becuase it will introduce voltage into the circuit and may damage out TCON chip.
    That makes absolutely no sense. What do you think is happening when you write the digital lines? You're setting a pin high. That voltage is being generated by the 8451x. I think you're not understanding what your mentor is saying. If it's an I2C device then you should be able to use the I2C function to simply talk to it. You still have not indicated what the device is, so there's little more I can say about that aspect of it.
    As far as the conversion is concerned, you basically need loop through your array of "bits", taking 16 at time since you said you have 16-bit values. It's not clear from your code whether your eventual goal is to get a numeric value or a string. This does not appear to be a subVI, so a simply numeric indicator formatted to display in hex format should be quite adequate. The array you are generating is an array of rings, whose datatype is I32, but they will have values of 0 or 1. You can use the example just posted, or you can use the attached variation.
    Attachments:
    Bits to Hex 2.vi ‏17 KB

  • List size in bytes

    Is it possible via the object model or web servecies to get the size of a list in bytes much like storman does?  The only issue with storman is that it will only display 100 lists and I have a site collection with thousands.  Any help would be
    greatly appreciated.
    Thanks,
    Dan
    Dan Marth

    Hello Dan,
    No direct class available in SP to get the size so you need to measure the each item size and then calculate them in byte. Refer this link:
    http://rajeshagadi.blogspot.nl/2011/04/how-to-find-sharepoint-list-and.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Urgent: How to find out the size in bytes of java object

    Hi Experts,
    We've a requirement that we need to find out the size of a java object at run time, is there a direct java API to get the size of a composite object in memory?
    Here is my requirement: We are adding string objects (which is an xml string of considerable size) into a List. After reaching certain size limit (lets say 5MB) of the list i need to put this data into DB as a CLOB. So every time I add a string object to the list, I need to see if the total size of the list exceeds the limit and if yes, flush the results into DB.
    I am not sure if java has a direct API for this, if not what is the beast way to do it, it s critical requirement for us.
    It would be really great if someone could help us out.
    Thank you,
    -Shibu.

    >
    We've a requirement that we need to find out the size of a java object at run time, is there a direct java API to get the size of a composite object in memory?
    Here is my requirement: We are adding string objects (which is an xml string of considerable size) into a List. After reaching certain size limit (lets say 5MB) of the list i need to put this data into DB as a CLOB. So every time I add a string object to the list, I need to see if the total size of the list exceeds the limit and if yes, flush the results into DB.
    I am not sure if java has a direct API for this, if not what is the beast way to do it, it s critical requirement for us.
    It would be really great if someone could help us out.
    >
    Could you explain your actual requirement a little more fully.
    1. Is each individual string a separate XML string? Or is it just a fragment? Why would you just concatenate them together into a CLOB? That won't produce valid XML and it won't let you easily separate the pieces again later. So provide a simple example showing some strings and how you need to manipulate them.
    2. Are you using these xml strings in Java at all? Or are you just loading them into the database?
    For example if you are just loading them into the database you don't need to create a list. Just create a CLOB in Java and append each string to the CLOB. Before you append each one you can check to see if the new string will put you over your length limit. If it will then you write the CLOB to the database, empty the CLOB and start appending again to the new clob instance.
    If you explain what you are really trying to do we might be able to suggest some better ways to do it.

  • GUI_DOWNLOAD give 2 bytes for each chinese character - I need fixed length

    Due to the Unicode system takes each Chinese character as a byte, the field(10) can take 10 Chinese Characters, not like before only 5 characters allowed.
    The problem is when the data is downloaded to a txt file. Some records contains only Western Europe charactes and will fill 10 bytes in the output file and other records contains only Chinese characters and will fill up 20 bytes in the output file.
    The data is exported for a system that can upload chinese characters, but only allow fixed record length file (always 10 bytes).
    In other words: the records with Western Europe characters should contain 10 characters = 10 bytes but the records with Chinese characters should only contain 5 characters = 10 bytes.
    Anyone who can solve this, thanks in advance.
    My code:
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
          FILENAME                = p_file
          CONFIRM_OVERWRITE       = 'X'
          codepage                = '8400' "Chinese
        CHANGING
          DATA_TAB                = it_output
        EXCEPTIONS

    Hi Thomas,
    Now I understand.
    Pl. check the class CL_ABAP_CONV_X2X_CE.
    May it can help u.
    Here is it's documentation.
    CL CL_ABAP_CONV_X2X_CE
    Short Text
    Code Page and Endian Conversion Between External Formats
    Functionality
    Instances of the class CL_ABAP_CONV_X2X_CE allow you to convert text data between different character sets and numeric data between different number formats (byte order).
    Using the class corresponds to transforming data from a binary input stream to a binary output stream: The data objects are read from the input buffer sequentially and written to an output buffer.
    The class methods are normally used as follows:
    CL_ABAP_CONV_X2X_CE=>CREATE
    This creates a conversion instance. Among other options, you can specify the following as parameters: The input buffer (that is the binary string that contains the data to be read), the character format at used in the input buffer, the byte order used in the input buffer, the character format to be used in the output buffer, or the byte order to be used in the output buffer.
    CONVERT_C, CONVERT_...
    This converts the data. Calling this method several times consecutively allows you to read data from the input buffer sequentially and add it to the end of the output buffer.
    GET_OUT_BUFFER
    This gets the output buffer, making it available for further processing (such as writing to a file, sending using RFC).
    RESET
    This allows you to reset individual attributes of the conversion instance. (This method is especially designed for restarting on a new input buffer and deleting the output buffer while retaining the remaining attributes.)
    Relationships
    CL_ABAP_CONV_IN_CE
    Converting Binary Data into ABAP Data Objects
    CL_ABAP_CONV_OUT_CE
    Converting ABAP Data Objects to a  Binary Format.
    CL_ABAP_CHAR_UTILITIES
    Various Attributes and Methods for Character Sets and Byte Order
    Example
    In the following example, UTF-8 texts are converted to the codepage 1100 (Latin-1) and numbers are converted from little-endian to big-endian format:
    DATA:
      in_buffer TYPE XSTRING,
      out_buffer TYPE XSTRING,
      conv TYPE REF TO cl_abap_conv_x2x_ce.
    in_buffer = '414220C3B602010000'.
    conv = cl_abap_conv_x2x_ce=>create(
             in_encoding = 'UTF-8'
             in_endian = 'L'
             out_encoding = '1100'
             out_endian = 'B'
             input = in_buffer
    CALL METHOD conv->convert_c( n = 5 ).
    CALL METHOD conv->convert_i( ).
    out_buffer = conv->get_out_buffer( ).
    The content of the in_buffer variable is made up of  5 bytes (hexadecimal "414220C3B6"), which represent 4 UTF-8 characters (A, B, SPACE, o-Umlaut), and 4 bytes (hexadecimal "02010000"),  which represent the value 258 in little-endian format. This data is converted and the out_buffer variable now contains the hexadecimal string "414220F600000102". It is made up of:
    4 bytes (hexadecimal "414220F6"), which represent the above  4 characters in codepage 1100 (ISO-8859-1). Note that the length specification n = 5 refers to the number of elementary characters to be converted. For multi-byte codepages like UTF-8 this means that the multi-byte character "C3B6" is counted in length 2.
    4 Bytes (hexadecimal "00000102"), which represent the value 258 in big-endian format.
    If you have the desired byte order in the old format as expected by TRANSLATE ... NUMBER FORMAT (as an N(4) value), you can proceed as follows:
    TYPE-POOLS: ABAP.
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    DATA:
      in_number_format(4) TYPE N VALUE '0101',
      out_number_format(4) TYPE N VALUE '0000'.
    DATA:
      in_endian TYPE ABAP_ENDIAN,
      out_endian TYPE ABAP_ENDIAN,
      conv TYPE REF TO cl_abap_conv_x2x_ce..
    in_endian  = cl_abap_char_utilities=>number_format_to_endian(
                   in_number_format
    out_endian = cl_abap_char_utilities=>number_format_to_endian(
                   out_number_format
    conv = cl_abap_conv_x2x_ce=>create(
             in_encoding = 'UTF-8'
             in_endian = in_endian
             out_encoding = '1100'
             out_endian = out_endian
             input = in_buffer
    Notes
    For details refer to the documentation for the individual methods.
    Regards,
    Joy.

  • How do I Keep the "zoom" size setting the same each time I open Safari and from web page to web page?

    I have a 27" iMac when I open Safari the web page is only 1/3 the size of the full screen Safari window. I know how to ZOOM in on the web page! My question is, How do I keep this ZOOM setting for all web pages and each time I open Safari up?

    Sorry, but that's not possible.
    An alternative might be to use Zoom in System Preferences > Accessibility
    Or try a different screen resolutioin in System Preferences > Displays > Scaled

Maybe you are looking for

  • JCAPS6- Migration "Method not found in the imported class"

    Hi, I work on Jcaps6 migration, I found that few of my migrated Jcd's throw compiler error as here ERROR: Method getSegmentCount(java.sql.Connection, java.lang.String, java.lang.String) not found in class com.ack.mware.distribution.v2.filesplitter.In

  • How to use CFschedule?

    I am trying to send an email with CFschedule... from what I can tell by looking at the documentation, I am doing it right. I am not getting any error messages but the email is not sending. The CFschedule is the action page of a form. When the form pr

  • MIssing px.dll file

    I am trying to create a offline backup of my PSE 6 library and the program says that px.dll is missing and I cannot do a backup to a DVD disc. What can I do? How do I only backup a certain part of my timeline? If I choose a certain time period ie 200

  • WLS 6.0 and 6.1 ejb questions

     

  • How to un-expand text?

    I got a file from a coworker that include some text. I would like to replace the text with my own, but his text have been "expanded" and each letter is on its own layer as a <compound path> in a group. Is there a way for me to return this as a editab