Re: calculate maximum size in bytes of a table row

From: joel garry <joel-garry_at_home.com>
Date: Fri, 18 Apr 2008 09:58:46 -0700 (PDT)
Message-ID: <3ead0326-21b5-462d-9ebd-56bebe3e845f@w1g2000prd.googlegroups.com>


On Apr 18, 5:24 am, steven acer <dudest..._at_gmail.com> wrote:
> how can i calculate the maximum amount of bytes that can be occupied
> by a table row.
> The table might not have any data in it, i'm looking for a calculation
> based on the data types used for columns.All i found so far was
> algorithms to estimate the average size for existing rows.
> i'm trying to spool the contents of some of my tables to flat files,
> and for that i'm trying to figure out if the rows would not be
> truncated by sqlplus due to its bytes/line limitation by calculating
> the maximum size a row can reach in bytes.
> database version is 10g R2 running on RHEL 4

I just tried select max(length(field1)+length(field2)...) from table_name; (from a real table with real fields, of course) and it was syntactically correct and the number looked ok, but I don't have time to actually verify it...

This would be a useful query.

jg

--
@home.com is bogus.
"due to an unfortunate and very rare combination of hardware problems
and backup configuration settings..."  http://catless.ncl.ac.uk/Risks/25.11.html#subj5
Received on Fri Apr 18 2008 - 11:58:46 CDT

Original text of this message