Posted by Jerry Stuckle on 11/07/07 13:16
steeve_dun@SoftHome.net wrote:
> Hi,
> What I want is to check for empty values for field 2 and put a result
> a function instead.
> eg :
>
> function func1($val){
> return $val.'bis';
> }
>
> $query = "UPDATE vals SET val2 = '".func1(`val1`)."' WHERE `val2` IS
> NULL";
>
> but the problem is that I can't recover val1 in func1
>
> So, is there a way to do so?
> Thanks
>
>
Nope, you can't retrieve the value in an update statement. You'll need
to SELECT the row then process it.
Or check a SQL newsgroup for a way to do it in SQL.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|