Datatypes lengths in bytes
Posted in 2000
Topics: Storage & Space Management, Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Jobs, Consulting & Announcements
Does somebody have some stored procedure or 4gl code that returns the number bytes used by a column? I need to know the lenghts of the columns used by the indexes of a table. I'll use the code to develop a script or 4gl to calculate the extents sizes for an existing table. Thanks in advance !!! -- Manuel A. Daponte Santiago Systems Consultant, ICP Sent via Deja.com http://www.deja.com/ Before you buy.
In article <854q0s$lqe$1@nnrp1.deja.com>, mdaponte@prtc.net wrote: > Does somebody have some stored procedure or 4gl code that returns the > number bytes used by a column? I need to know the lenghts of the > columns used by the indexes of a table. > > I'll use the code to develop a script or 4gl to calculate the extents > sizes for an existing table. > > Thanks in advance !!! > > -- > Manuel A. Daponte Santiago > Systems Consultant, ICP > > Sent via Deja.com http://www.deja.com/ > Before you buy. > You can get some of that information from syscolumns.collength. Datetime and interval will show what looks like bogus numbers, though. That is actually a bitmask used to format the date. The actual size of a datetime or interval column is 16 bytes, I believe. Varchar will be the collength + 2. I think that covers all of the odd ones... PS. Using this table is not necessarily portable between Informix versions. All of the sysXXX tables are internal and are subject to change. -- # unrm / ksh: unrm: not found # man cpio Sent via Deja.com http://www.deja.com/ Before you buy.
You could wait for me to release my calcext script. I'm just making some minor changes suggest by Art S Kagel ( thanks ) , after that I'll forward it to iiug. If you want I can e-mail it to you directly. Its PERL. .