|Subject:||Oracle For Fun|
|Posted by:||Daniel Morgan (damorg…@x.washington.edu)|
|Date:||Mon, 26 Jan 2004|
At a class I taught this last weekend I brought up the fact that most
PL/SQL programmers are still writing v7 code. I gave everyone there a
challenge and thought I'd share it with the group for any of you looking
for a challenge on which to sharpen your skills.
CREATE TABLE t1 AS
CREATE OR REPLACE PROCEDURE test_proc IS
FOR x IN (SELECT * FROM all_objects)
INSERT INTO t1
(owner, object_name, subobject_name, object_id,
data_object_id, object_type, created, last_ddl_time,
timestamp, status, temporary, generated, secondary)
(x.owner, x.object_name, x.subobject_name, x.object_id,
x.data_object_id, x.object_type, x.created,
x.last_ddl_time, x.timestamp, x.status, x.temporary,
set timing on
set timing off
Everyone using 8i+ features should be able to improve the performance of
this by at least 5X.
I'll post a solution in a week or so.
(replace 'x' with a 'u' to reply)