Bug #39371 In powerbuilder 9 User variables does not work with aggregate functions
Submitted: 10 Sep 2008 13:37 Modified: 10 Sep 2008 15:33
Reporter: Oscar Mateus Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:5.1 OS:Windows
Assigned to: CPU Architecture:Any
Tags: avg, MAX, min, sum

[10 Sep 2008 13:37] Oscar Mateus
Description:
I am using powerbuilder 9.0-11.2 and use following statment
Error Messagee :
SQLSTATE = 37000
[MySQL][ODBC 5.1 Driver][mysqld-5.0.67-community-nt]FUNCTION montacargas.sum does not exist

Code : 

double ldb_prueba
select sum(valor_total) into :ldb_prueba from factura;

if SQLCA.SQLCode < 0 then 
   MessageBox("SQL error",SQLCA.SQLErrText,Information!)
   return
end if

dbparm
DBParm=ConnectString='DSN=test_local;UID=root;PWD=tecno';DisableBind=1;option=0;

Version
ODBC 5.1 Driver

How to repeat:
I tried this command in powerbuilder database administrator option without using into plane statement it works i tried max, min and sum all aggricated funciton fail when i try to stored result in variable.
[10 Sep 2008 15:33] Oscar Mateus
The solution that i found is add in the dbparm option=135168
eg.
ConnectString='DSN=test_local;UID=root;PWD=tecno;OPTION=135168',PBUseProcOwner="NO"

thanks.
[9 May 2009 5:09] Philip Arce
try adding {}

ex.
select {sum(valor_total)} into :ldb_prueba from factura;