select docnum from mhgroup.docmaster
guaranteed to be one of the values returned by the query,
but you don't know which one.
If you assign using SET instead of SELECT, it's safer, since
you'll get an error if you try to assign more than one value:
I assume you need a where clause in this select, and probably
some change to the update query, since it will set cdbl1 to the
same value for every row in the table.
To copy one column to another (I'm not sure why you would need
two identical columns, but it sounds like you are saying that), you
can do it for every row in the table as
set cdbl1 = docnum
> I administer a document management database and have a requirement to
> copy the numerical value ( the document number) from one field into
> another custom field in each row. For new documents I have written a
> trigger to achieve this, but I am having trouble doing this for existing
> documents. As a bit of a newbie, I can't find a way to make the query
> pick up the correct value, instead it inserts the first docnum value it
> finds, and it then puts this into the custom field in all the rows! Here
> is the query:
> update mhgroup.docmaster
> Many thanks
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!