CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge -> General/Other

 SOLVED - Custom Code - MySQL with more than one GREATEST - Fails

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.