Windows Utilities

CNET has an excellent article on free Windows utilities at download.com.  Featured tools include Firefox, Thunderbird, OpenOffice, Gimp, Paint.NET, MediaMonkey, 7-zip, Foxit, Pidgin, Smart Defrag, WinDirStat and Process Explorer.

Process Explorer is part of the Windows Sysinternals Suite available from Microsoft for power users.

Microsoft also provide free downloads of their Live Essentials applications, which include Messenger, and Writer for offline blog editing.  Google Picasa, however, is much better than Windows Live Photo Gallery.

Wakoopa have a utility and community site for tracking member application usage.  Application rankings and reviews are available by category.

Adding a surrogate key to an Oracle table

This works for me for a mid-sized table.

ALTER TABLE foo ADD ( foo_id integer )
/
CREATE SEQUENCE foo_id_seq
/
CREATE OR REPLACE TRIGGER before_update_foo
   BEFORE INSERT OR UPDATE
   ON FOO
   REFERENCING OLD AS old NEW AS new
   FOR EACH ROW
DECLARE
   l_foo_id   foo.foo_id%TYPE;
BEGIN
   IF :new.foo_id IS NULL
   THEN
      SELECT   foo_id_seq.nextval INTO l_foo_id FROM dual;

      :new.foo_id := l_foo_id;
   END IF;
END;
/
UPDATE   foo
   SET   foo_id = NULL
/
COMMIT
/
CREATE UNIQUE INDEX foo_ak
   ON foo( foo_id )
/
ALTER TABLE foo MODIFY ( foo_id NOT NULL )
/
ALTER TABLE foo ADD (CONSTRAINT foo_ak UNIQUE (foo_id))
/
Scroll to top