[imp] SQL Help required - if possible

Nigel Cass N.Cass@Hull.ac.uk
Wed, 25 Sep 2002 13:17:38 +0100


Hi Guys.

Recently rolled out a webmail system which has been reasonably well
received by my user community. Unfortunately I've just realised I've
implemented something of a design flaw.

That being that I'm using realms (as at the moment we have two separate
imap servers) as it seemed wise to do so just in case of the odd clash
etc. However we have recently decided that in the not too distant future
we will move to only one imap server for all. Clearly this is a bit of a
problem as it means that peoples preferences and turba objects will be
unaccessible as we will need to set either one of the two realms used or
preferably no realm.

I'm keen to fix this sooner rather than later before the databases grow
too huge and the problem thus becomes bigger.

My question is really for the SQL gurus out there.

Is there a reasonably easy way of doing the following (pseudo SQL)

UPDATE horde_prefs SET pref_uid = (part before @) WHERE pref_uid = (
"part before @"@realmname notneeded anymore)

Or am I going to have to dump the database then insert copies of the old
records with sensible pref_uids, then remove he realm setting and
eventually delete all the old records ?

TYIA

Nigel Cass.