vfrost
Posts: 2
|
Posted: 10/10/2009, 10:54 PM |
|
Situation:
The following custom code (After Update Event) works when coded with ONE 'GREATEST' statement. Yes, it works for either variable (only one at a time).
When I do two "GREATEST" statements (or more), it fails.
I feel I have verified the inputs (text boxes of 'mar' and 'surg') are correct.
CODE that does not work on CodeCharge; but, does work in MYSQL (substituting values of course):
$SQL="UPDATE t_cptfee ".
" set ".
" mar = ".
" GREATEST(".CCGetParam(mar)."+0,0), ".
" mar_note = ".
" '".CCGetParam(mar_note)."', ".
" surg = ".
" GREATEST(".CCGetParam(surg)."+0,0), ".
" surg_note = ".
" '".CCGetParam(surg_note)."', ".
" uuid = ".
" ".$user.", ".
" udt = ".
" utc_timestamp() ".
" where ".
" pk_cptfee = ".CCGetParam(pk_cptfee)." ";
Thanks.
As always, I suppose I'll get various ways to avoid the use of GREATEST; however, this should work!
Temporally, I'm doing many updates in the custom code (one text box variable at a time) in multiple MySQL queries.
Oh.. I'm on CodeCharge Studio 4.3.00.53
_________________
Vaughn Frost
vaughn@service4gis.com |
|
|
vfrost
Posts: 2
|
Posted: 10/13/2009, 10:09 AM |
|
*SOLVED*
The issue was that prior Parameters were being passed that had different numerical values.
The "GREATEST" (multiple times in SQL) works as designed.
_________________
Vaughn Frost
vaughn@service4gis.com |
|
|
|