Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
D. Wilson — — source: Informix-list mailing list archive (1991-1998)
casfra01 wrote:
>
> Can I update a field with a return of a select? For example :
>
> " Update table1
> set table1.field1 = (select table2.field2
> from table2
> where table2.filed3 = table1.filed3)"
>
> Thank you for the answer.
As long as the select returns one and only one row,
and table1 is not related to table2 (through synonyms or
views, etc.) it should be ok. Why do you ask? Have you
tried it yet? Are you experiencing problems?
If there is more than one (or zero?) rows returned, or if
table1 is the same as table2, then you need a different
approach. Are you using SQL or 4gl?
Douglas Wilson
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.