“But that worked yesterday!” or, why you should test with utPLSQL

Automated self-tests are a fundamental part of application- and web-development
nowadays, even to the point where one can’t imagine modern software development
without them. Yet they are still surprisingly uncommon in the database.
This article shows how easy it is to start developing self-tests in Oracle with utPLSQL
version 3 and what benefits these tests will bring to your project
and your software.

Updating a Table with the Values of a Different One

I am working professionally with databases for over 15 years now and have a huge focus on Oracle – but I really keep forgetting how to update a table with values of a different one (this is one thing which is so much easier in SQL Server by the way).

Therefore let’s assume we have a table containing planets and one containing garrisons which are on these planets.

Garrison IDPlanet NamePlanet Faction
3Dromund Kaasimperium

We would now like to have a new column in the garrisons table which can contain a name.

alter table garrisons add name varchar2(300)

The imperial side now has a request to update all their garrisons with a name according to this schema: <PlanetName> (<Garrison ID>)