LOCAL lcAlias, lcSQL, lcCursor, lnRows, laError[1] lcAlias = ALIAS() lcCursor = SYS( 2015 ) lcSQL = "SELECT count(*) as totrecs "+; "FROM " + IIF( EMPTY( This.FromClause ), LOWER( This.Alias ), This.FromClause ) IF This.SQLExecute( lcSQL, lcCursor ) lnRows = VAL( totrecs ) && count(*) returned a 20 character result; option=536870912 USE IN ( lcCursor ) ELSE = AERROR( laError ) MESSAGEBOX( "[ "+ ( This.Alias ) +" ] GetTotalRowCount Error occurred: " + CHR(13) + CHR(13) + laError[ 2 ] ) ENDIF IF NOT EMPTY( lcAlias ) SELECT ( lcAlias ) ENDIF RETURN lnRowsWhen it is the turn of oPIHDR, whose SQL statement is:
select a.*, b.code as supcode, b.descriptor as supname, c.code as ewtaxcode, c.descriptor as ewtaxname, d.code as jtcode, d.descriptor as jtname from pihdr a left join supplier b on a.supplierid=b.id left join ewtax c on a.ewtaxid=c.id left join jthdr d on a.jthdrid=d.idwhich should converted into (by GetTotalRowCount():
select count(*) from pihdr a left join supplier b on a.supplierid=b.id left join ewtax c on a.ewtaxid=c.id left join jthdr d on a.jthdrid=d.idWhen this last sql statement is run, it produces that error. I ran an ODBC trace log, it shows the error but the statement is not found in the log.
>>************************************************** >>*-- Class: bopi (d:\vfpxdev\metalbank\classes\metalbank.vcx) >>*-- ParentClass: bobook (d:\vfpxdev\metalbank\classes\metalbank.vcx) >>*-- BaseClass: dataenvironment >>*-- Time Stamp: 07/30/22 02:04:05 PM >>* >>DEFINE CLASS bopi AS bobook >> >> >> Width = 277 >> Height = 136 >> InitialSelectedAlias = "pihdr" >> Name = "bopi" >> >> >> ADD OBJECT opijrnl AS capijrnl WITH ; >> Top = 84, ; >> Left = 96, ; >> SelectCmd = "select a.*, b.code as glcode, b.descriptor as glname, b.withsubs, b.isentity, b.entityid, c.code as slcode, c.descriptor as slname from pijrnl a inner join glacct b on a.glacctid=b.id left join slacct c on a.slacctid=c.id where a.hdrid=?pihdr.id", ; >> userecordpagination = .F., ; >> parentalias = "pihdr", ; >> Name = "oPIJrnl" >> >> >> ADD OBJECT opidtl AS capidtl WITH ; >> Top = 87, ; >> Left = 30, ; >> SelectCmd = "select a.*, b.code as prodcode, b.descriptor as prodname, b.uom, b.unitcost1, b.unitcost2, b.unitcost3, b.unitcost4, b.unitcost5, b.unitcost6, b.unitcost7, b.unitcost8 from pidtl a inner join product b on a.productid=b.id where a.pihdrid=?pihdr.id", ; >> userecordpagination = .F., ; >> parentalias = "pihdr", ; >> Name = "oPIDtl" >> >> >> ADD OBJECT opihdr AS capihdr WITH ; >> Top = 38, ; >> Left = 69, ; >> Name = "oPIHdr" >> >> >> ADD OBJECT ojthdr AS cajthdr WITH ; >> Top = 24, ; >> Left = 168, ; >> SelectCmd = "select a.*, b.txncode, b.txndesc from jthdr a inner join book b on a.bookid=b.id where bookid=?this.txncode order by txncode, code", ; >> cursortype = 2, ; >> txncode = "PB", ; >> Name = "oJTHdr" >> >> >> ADD OBJECT ojtdtl AS cajtdtl WITH ; >> Top = 48, ; >> Left = 168, ; >> SelectCmd = "select a.*, b.code as glcode, b.descriptor as glname, b.withsubs, b.isentity, b.entityid, c.fielddesc from jtdtl a inner join glacct b on a.glacctid=b.id inner join bookdata c on a.fieldid=c.fieldid where a.jthdrid=?jthdr.id", ; >> cursortype = 3, ; >> Name = "oJTDtl" >> >> >> ADD OBJECT osysparm AS casysparm WITH ; >> Top = 24, ; >> Left = 216, ; >> cursortype = 2, ; >> Name = "oSysparm" >> >> >>ENDDEFINE >>* >>*-- EndDefine: bopi >>************************************************** >>>>
>>>>driver=MySQL ODBC 8.0 Unicode Driver >>>>server=localhost >>>>port=1686 >>>>uid=root >>>>pwd=p@55w0rd >>>>database=metalbank >>>>option=536870912 >>>>sslmode=DISABLED >>>>>>>>
>>>>>>ERROR [01000] [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.29]The number of attributes is larger than the number of attribute values provided >>>>>>>>>>>>
>>>>>>>>>?CAST(4000000000 as int) && return -294967296 >>>>>>>>>>>>>>>>>>
>>>>>>>>>select CAST(4000000000 AS DECIMAL(20)) >>>>>>>>>-- select CAST(4000000000 AS INTEGER) -- converts to bigint - by documentation >>>>>>>>>>>>>>>>>>
>>>>>>>>>>select 1 >>>>>>>>>>select 10 >>>>>>>>>>select 10000 >>>>>>>>>>select 4000000000 >>>>>>>>>>>>>>>>>>>>