The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.
Thanks for the question, Dariusz.
Asked: November 22, 2019 - 2:35 pm UTC
Last updated: November 25, 2019 - 12:19 pm UTC
Version: Oracle database 12c
Viewed 1000+ times
declare l_stmt long := 'c1 int'; begin for i in 2 .. 999 loop l_stmt := l_stmt || ', c' || i || case mod ( i, 3 ) when 0 then ' int' when 1 then ' varchar2(100)' when 2 then ' date' end ; end loop; execute immediate 'create table t1 ( x int, ' || l_stmt || ')'; execute immediate 'create table t2 ( ' || l_stmt || ', x int )'; end; / insert into t1 (x) select object_id from all_objects; insert into t2 (x) select x from t1; commit; select segment_name, bytes from user_segments where segment_name in ( 'T1', 'T2' ); -- results from 19c SEGMENT_NAME BYTES T1 917504 T2 88080384 -- results from 11.2 SEGMENT_NAME BYTES T1 2097152 T2 109051904
The Oracle documentation contains a complete SQL reference.