Re: How To Update A Field ?
Date: Mon, 28 Jun 1999 17:25:00 GMT
Message-ID: <3778abbc.5505937_at_news.u-net.com>
Hi,
Correct. Well spotted.
It would be necessary if you could have an Employee ID without an Employee Name. I didn't expect that the name would be null if the id existed.
graham
On Sun, 27 Jun 1999 21:43:08 -0500, Angelica Veron <Faro_at_globalserve.net> wrote:
>Hello Graham,
>
> Thank you so much for your help, I have tried this query and it has
>worked, but I am just wondering what the effects are of adding one more
>statement to the end of that query...
>
>UPDATE WrongTable
> SET WrongTable.employee_name =
> (SELECT CorrectTable.employee_name
> FROM CorrectTable
> WHERE CorrectTable.employee_id = WrongTable.employee_id)
>WHERE
> EXISTS
> (SELECT CorrectTable.employee_name
> FROM CorrectTable
> WHERE CorrectTable.employee_id = WrongTable.employee_id
> AND c1.employee_name IS NOT NULL);
>
> You can see the extra line at the end is suggested... my question is,
>is it necessary to put that in, or not ??.. I thought of placing this line
>because if Field 1 is NOT NULL type then the query would not run as an error
>would be reported of an attempt to insert a NULL value into a NOT NULL field.
>But if your query avoids this without the need for that last statement then
>please let me know, once again thank you so much for your time.
>
>
Received on Mon Jun 28 1999 - 19:25:00 CEST