...
> > select distinct
> > uid = 'c' + trim(char(m.ctc_uid)),
> > command = e.msg_command,
> I think you probably want something like
> e.msg_command AS command,
and something like
('c' + trim(char(m.ctc_uid))) as uid,
which have forms more closely tied to SQL9x standards than your original
form.
While you are at it you might want to evaluate your needs for character
strings and choose the type (char, varchar, or text) which best matches
your application. You may be able to eliminate some of these
conversions.
- Thomas