RAO,
I wanted to ask you for advice on how to use tables with millions of data without experiencing a loss of performance
Grazie Maurizio
I'm trying oCn:RecSet() and it's very, very fast, I noticed that certain methods that work with oCn:Rowset() with :RecSet() don't work.
#include "fivewin.ch"
function Main()
local oCn, oRs, nSum, nSecs
SET DATE ITALIAN
SET CENTURY ON
FWNumFormat( "A", .t. )
FW_SetUnicode( .t. )
CursorWait()
oCn := maria_Connect( "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", .t. )
oCn:lShowErrors := .t.
nSecs := SECONDS()
MsgRun( "Reading `custbig`", "Please wait", { || oRs := oCn:RecSet( "custbig", -100 ), ;
nSum := oCn:QueryResult( "SELECT SUM(SALARY) FROM `custbig`" ) } )
nSecs := SECONDS() - nSecs
XBROWSER oRs TITLE " CUSTBIG (" + cValToChar( nSecs ) + ") seconds" ;
FASTEDIT SHOW RECID SETUP ( ;
oBrw:id:cEditPicture := "99,999,999", ;
oBrw:nFreeze := 1, ;
oBrw:Salary:nFooterType := AGGR_SUM, ;
oBrw:Salary:nTotal := nSum, ;
oBrw:aSumCols := { oBrw:oCol( "SALARY" ) } )
oCn:Close()
return nil
WITH OBJECT oBrw:oRs
:Close()
:Source := cNewSelectWithWhere
:ActiveConnection := oServer
:Open()
END
oBrw:Refresh()
#include "fivewin.ch"
function Main()
local oCn, oRs
local cSql := "SELECT * FROM custbig WHERE STATE="
SET DATE ITALIAN
SET CENTURY ON
FWNumFormat( "A", .t. )
FW_SetUnicode( .t. )
CursorWait()
oCn := maria_Connect( "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", .t. )
oCn:lShowErrors := .t.
oRs := RecSetNew( oCn, cSql + "'NY'" )
XBROWSER oRs TITLE "CUSTBIG" FASTEDIT SHOW RECID SETUP ( ;
oBrw:bRClicked := { |r,c,f,o| ChangeRecSet( o, cSql + "'WA'" ) } )
oCn:Close()
return nil
function RecSetNew( oCn, cSql )
local oRs
MsgRun( "Reading `custbig`", "Please wait", ;
{ || oRs := oCn:RecSet( cSql, -100 ) } )
return oRs
function ChangeRecSet( oBrw, cSql )
local oRs := oBrw:oDbf
oBrw:oDbf := RecSetNew( oRs:oCn, cSql )
oRs:Close()
oBrw:GoTop()
oBrw:Refresh()
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 83 guests