RowSet Large and lReadonly

Post Reply
User avatar
Eroni
Posts: 100
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil
Contact:

RowSet Large and lReadonly

Post by Eroni »

Dear all,
Is possible rowset and lreadonly works the same time?
Like this:

Code: Select all | Expand

oRs := oCn:RowSet( <table>, nRows,.T. )
Regards.
FWH 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: RowSet Large and lReadonly

Post by nageswaragunupudi »

Yes
Regards

G. N. Rao.
Hyderabad, India
User avatar
Eroni
Posts: 100
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil
Contact:

Re: RowSet Large and lReadonly

Post by Eroni »

Thank you Mr. Rao.

I tried built other sample:

Code: Select all | Expand

function Test()
    local oRs, cTable,oCn
    local oWnd, oBrw, oFont

   oCn := maria_Connect( "209.250.245.152,fwh,fwhuser,FiveTech@2022" )
   if oCn <> NIL
    ? "Conected"
   endif 
   
   oRs := oCn:RowSet( "select * from custx where state = ? ",{ 'NY' },500,.T. )

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-14
   DEFINE WINDOW oWnd
   oWnd:SetFont( oFont )

   @ 0,0 XBROWSE oBrw OF oWnd ;
      DATASOURCE oRs AUTOCOLS ;
      CELL LINES FOOTERS NOBORDER

   WITH OBJECT oBrw
      :bRecSeldata   := { || oBrw:KeyNo }
      :nRecSelWidth  := "999,999"
      :bRecSelFooter := { || oBrw:nLen }
      :CreateFromCode()
   END

   oWnd:oClient := oBrw

   DEFINE TIMER oTimer INTERVAL 1000 ACTION __ReadMore( oBrw ) OF oWnd

   ACTIVATE WINDOW oWnd CENTERED ;
      ON INIT ( oTimer:Activate() )

   RELEASE FONT oFont
   oTimer:DeActivate()
   oTimer:End()
   oCn:Close()
   
return nil


func __ReadMore( oBrw )

   local cMsg

   if ! PeekMessage( @cMsg, oBrw:hWnd, 0x100, 0x109, 0 )
      WITH OBJECT oBrw
         if :oDbf:lMore
            :oDbf:ReadNext( 5555 )
            :GoBottom()
            :Refresh()
         else
            oTimer:DeActivate()
         endif
      END
   endif

return nil   
 
But result error:

Code: Select all | Expand

Código           : 1
Descrição do Erro:
Erro BASE/1070  Erro nos parƒmetros: ==
Código: 1
Detalhamento:
------------
Arg. 1      Tipo: O Valor: FWMARIACONNECTION
Arg. 2      Tipo: L Valor: .T.

Chamada de Pilha
================
Chamado de FWMARIAROWSET:NEW(1580)
Chamado de FWMARIACONNECTION:EXECUTE_SQL(6837)
Chamado de FWMARIACONNECTION:ROWSET(7549)
Chamado de MARIANEWRECORD(202)
Any other ideas?

Regards
FWH 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: RowSet Large and lReadonly

Post by nageswaragunupudi »

Code: Select all | Expand

oRs := oCn:RowSet( "select * from custx where state = ? ",{ 'NY' },500,.T. )
This is working in the recent versions but not in 1709

This works in 1709

Code: Select all | Expand

oRs := oCn:RowSet( "select * from custx where state = 'NY' ",500,.T. )
OR

Code: Select all | Expand

oRs := oCn:RowSet( "select * from custx where state = ? LIMIT ? ",{ "NY", 500}, .T. )
Regards

G. N. Rao.
Hyderabad, India
User avatar
Eroni
Posts: 100
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil
Contact:

Re: RowSet Large and lReadonly

Post by Eroni »

Thank you Mr. Rao.

I am using FWH 23.10:

Code: Select all | Expand

Application
===========
   Path and name: D:\Softway\ProjetosWanderson\EsocialSQL\sinwin.EXE (32 bits)
   Size: ********* bytes
   Compiler version: xHarbour 1.3.0 Intl. (SimpLex) (Build 20231104)
   FiveWin  version: FWH 23.10
   C compiler version: Borland/Embarcadero C++ 7.7 (32-bit)
   Windows 11 64 Bits, version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 18 secs 
   Error occurred at: 01/06/2024, 09:48:42
   Error description: Error BASE/1070  Erro nos parƒmetros: ==
   Args:
     [   1] = O   FWMARIACONNECTION
     [   2] = L   .T.

Stack Calls
===========
   Called from: .\source\internal\FWMARIA.PRG => FWMARIAROWSET:NEW( 1580 )
   Called from: .\source\internal\FWMARIA.PRG => FWMARIACONNECTION:EXECUTE_SQL( 6837 )
   Called from: .\source\internal\FWMARIA.PRG => FWMARIACONNECTION:ROWSET( 7549 )
   Called from: D:\Softway\ProjetosWanderson\EsocialSQL\PRGh\funcao32.prg => MARIANEWRECORD( 202 )
 
What version must have I to use?

Regards.
FWH 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: RowSet Large and lReadonly

Post by nageswaragunupudi »

Here it is working for me with FWH2307 and FWH2310.
This is my sample program.

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oCn   := maria_Connect( "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", .t. )
   local oRs

   MsgRun( "Reading RowSet", "CUSTX", { || ;
   oRs   := oCn:RowSet( "select * from custx where state = ? order by id", { "NY" }, 30, .T. ) } )
   XBROWSER oRs SHOW RECID TITLE FWVERSION
   oRs:Close()

   oCn:Close()

return nil
Save this to samples and build with buildh.bat
Like this:
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: RowSet Large and lReadonly

Post by nageswaragunupudi »

Here it is working for me with FWH2307 and FWH2310.
This is my sample program.

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oCn   := maria_Connect( "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", .t. )
   local oRs

   MsgRun( "Reading RowSet", "CUSTX", { || ;
   oRs   := oCn:RowSet( "select * from custx where state = ? order by id", { "NY" }, 30, .T. ) } )
   XBROWSER oRs SHOW RECID TITLE FWVERSION
   oRs:Close()

   oCn:Close()

return nil
Save this to samples and build with buildh.bat
Like this:
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
Eroni
Posts: 100
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil
Contact:

Re: RowSet Large and lReadonly

Post by Eroni »

Thank you for your attention Mr Rao,

I just tested with harbour and really works fine.

But using xHarbour results an error:
http://flynfe.com.br/download/Sample.mp4
But ok, I will tray other way to handle my large databases.

Regards.
FWH 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: RowSet Large and lReadonly

Post by nageswaragunupudi »

But using xHarbour results an error:
Please write to me to this email address:
nageswaragunupudi [at] gmail [dot] com

We will send you revised libraries for both harbour and xharbour.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: RowSet Large and lReadonly

Post by nageswaragunupudi »

But ok, I will tray other way to handle my large databases.
For large tables, do NOT use RowSet.
There is another class RecSet specially made to handle very large tables.

Let us try to open "custbig" table which has more than 4 million records.

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oCn   := maria_Connect( "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", .t. )
   local oRs

   ? "reading custbig"
   oRs   := oCn:RecSet( "custbig", -100 )
   XBROWSER oRs SHOW RECID TITLE FWVERSION
   oRs:Close()
   oCn:Close()

return nil
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
Eroni
Posts: 100
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil
Contact:

Re: RowSet Large and lReadonly

Post by Eroni »

Mr Rao, everything ok now, with these 3 classes I can solve everything I need.

Thank you for your attention.

Regards.
FWH 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
Post Reply