dbalearner
Technical User
I have a table t that I created as follows:
CREATE TABLE T
AS
(
SELECT
a.*
,RPAD('*',4000,'*') AS PADDING1
,RPAD('*',4000,'*') AS PADDING2
FROM ALL_OBJECTS a
)
ORDER BY dbms_random.random;
ALTER TABLE T ADD CONSTRAINT T_PK PRIMARY KEY (object_id);
this table has around 70,000 rows with OBJECT_ID as the primary key.
I would like to create a new table t2 that will have a million rows based upon rows on table t. This is for test purposes.
However, object_id in the new table has to be unique. Can I create incrementing object_id values based upon max(object_id) from table t. An option that comes to my mind is using a sequence. Are there betterr ways of doing this?
Thanks
CREATE TABLE T
AS
(
SELECT
a.*
,RPAD('*',4000,'*') AS PADDING1
,RPAD('*',4000,'*') AS PADDING2
FROM ALL_OBJECTS a
)
ORDER BY dbms_random.random;
ALTER TABLE T ADD CONSTRAINT T_PK PRIMARY KEY (object_id);
this table has around 70,000 rows with OBJECT_ID as the primary key.
I would like to create a new table t2 that will have a million rows based upon rows on table t. This is for test purposes.
However, object_id in the new table has to be unique. Can I create incrementing object_id values based upon max(object_id) from table t. An option that comes to my mind is using a sequence. Are there betterr ways of doing this?
Thanks