Thanks in advance
Caroline Fallon
co...@compex.ie
This is perfectly possible, but a bit of a pain in the arse, because you
cannot use SUBSTR on the left hand side of an SQL operator. You can only
SET the entire contents of a field.
Taking your example of a 10 alpha field, here is how to change only the
first character to 'a', leaving the remainder of the field the same:
UPDATE file
SET field=('a' CONCAT SUBSTR(field, 2, 9))
WHERE someotherfield=whatever
the second example is even more annoying to construct. Here is how to set
only the second character to 'a', leaving all remaining characters
unchanged:
UPDATE file
SET field=(SUBSTR(field, 1, 1) CONCAT 'a' CONCAT SUBSTR(field, 3, 8))
WHERE someotherfield=whatever
Hope this helps you, let me know if you need further info explaining the
solutions, and if anyone else knows a better way, please tell me!
Cheers,
Simon.
Caroline wrote in message ...