result from select can be movefirts from ODBC?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

result from select can be movefirts from ODBC?

PICCORO McKAY Lenz
i try to filla gridview at demand, so due ODBC limitations i cannot count
so inside my bean-like object i count and tehen return properties..

the problem goes when i try to move to the fitrs record, i implement the
code in wrong way? :

Try resulobj = $conexionodbc.Exec(exisqueryrequest)

  While (resulobj.Available)

    If resulobj.MoveNext() Then
      resulhowmany = resulhowmany + 1
    Else
      Break
    Endif

  Wend

  resulobj.MoveFirst ' <--- here said that its foward only, that's true if
comes from a simple select ?



Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

PICCORO McKAY Lenz
sorry was bad implementation, fixed code:


    resulhowmany = resulhowmany + 1
    If resulobj.MoveNext() Then
      Break
    Endif

documentation said that when no records are available retuns true.. very
confused but well..


Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-05-17 12:13 GMT-04:00 PICCORO McKAY Lenz <[hidden email]>:

> i try to filla gridview at demand, so due ODBC limitations i cannot count
> so inside my bean-like object i count and tehen return properties..
>
> the problem goes when i try to move to the fitrs record, i implement the
> code in wrong way? :
>
> Try resulobj = $conexionodbc.Exec(exisqueryrequest)
>
>   While (resulobj.Available)
>
>     If resulobj.MoveNext() Then
>       resulhowmany = resulhowmany + 1
>     Else
>       Break
>     Endif
>
>   Wend
>
>   resulobj.MoveFirst ' <--- here said that its foward only, that's true if
> comes from a simple select ?
>
>
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

Tobias Boege-2
In reply to this post by PICCORO McKAY Lenz
On Wed, 17 May 2017, PICCORO McKAY Lenz wrote:

> i try to filla gridview at demand, so due ODBC limitations i cannot count
> so inside my bean-like object i count and tehen return properties..
>
> the problem goes when i try to move to the fitrs record, i implement the
> code in wrong way? :
>
> Try resulobj = $conexionodbc.Exec(exisqueryrequest)
>
>   While (resulobj.Available)
>
>     If resulobj.MoveNext() Then
>       resulhowmany = resulhowmany + 1
>     Else
>       Break
>     Endif
>
>   Wend
>
>   resulobj.MoveFirst ' <--- here said that its foward only, that's true if
> comes from a simple select ?
>

I don't understand your last question (and I have no idea about bean-like
objects outside of gardening) but according to the Result.MoveNext()
documentation [1]:

  Returns TRUE if the result is void or if there is no next record.

You seem to increment your counter when the move *fails*, which will give
you a wrong count. I usually do something like:

  ' Modifies the internal Result record pointer!
  Private Sub CountResult(hRes As Result) As Integer
    Dim iCount As Integer

    If hRes.MoveFirst() Then Return 0
    iCount = 1
    While Not hRes.MoveNext()
      Inc iCount
    Wend
    Return iCount
  End

Regards,
Tobi

[1] http://gambaswiki.org/wiki/comp/gb.db/result/movenext

--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

PICCORO McKAY Lenz
tobias, i answered few seconds, yeah the if was in wrong place.. thanks for
the corrections..

and u dont know that ODBC module in gambas does not implement or have same
behaviour of the others like sqlite or mysql..

count does not retunrs nothing, max neither so i must implement my own
count..

seems that mayority gambas develpoers only used mysql? nobody performs on
mayor scalar DBMS ? oracle, sybase, postgresql?

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-05-17 12:32 GMT-04:00 Tobias Boege <[hidden email]>:

> On Wed, 17 May 2017, PICCORO McKAY Lenz wrote:
> > i try to filla gridview at demand, so due ODBC limitations i cannot count
> > so inside my bean-like object i count and tehen return properties..
> >
> > the problem goes when i try to move to the fitrs record, i implement the
> > code in wrong way? :
> >
> > Try resulobj = $conexionodbc.Exec(exisqueryrequest)
> >
> >   While (resulobj.Available)
> >
> >     If resulobj.MoveNext() Then
> >       resulhowmany = resulhowmany + 1
> >     Else
> >       Break
> >     Endif
> >
> >   Wend
> >
> >   resulobj.MoveFirst ' <--- here said that its foward only, that's true
> if
> > comes from a simple select ?
> >
>
> I don't understand your last question (and I have no idea about bean-like
> objects outside of gardening) but according to the Result.MoveNext()
> documentation [1]:
>
>   Returns TRUE if the result is void or if there is no next record.
>
> You seem to increment your counter when the move *fails*, which will give
> you a wrong count. I usually do something like:
>
>   ' Modifies the internal Result record pointer!
>   Private Sub CountResult(hRes As Result) As Integer
>     Dim iCount As Integer
>
>     If hRes.MoveFirst() Then Return 0
>     iCount = 1
>     While Not hRes.MoveNext()
>       Inc iCount
>     Wend
>     Return iCount
>   End
>
> Regards,
> Tobi
>
> [1] http://gambaswiki.org/wiki/comp/gb.db/result/movenext
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

Cristiano Guadagnino
Hi PICCORO, I am a professional DBA working daily with IBM DB/2, Microsoft
SQL Server, Mysql.

First of all, let me tell you that a big effort is needed to read you
messages, because of your poor english and your writing style. I'm sorry if
I'm a bit blunt, but please... a little effort from you would be very
appreciated.
Anyway, if your native language is spanish I would appreciate if, when
speaking to me, you could add the spanish translation of your sentences...
it would help me understand better. I am italian but I know spanish quite
well.

That said, I fail to see why you're complaining about Mysql. I also fail to
see what mysql has to do with your failed efforts with ODBC. ODBC is a
protocol that tries to help developers by allowing them to "speak" the same
language to any underlying DBMS. ODBC then "translates" to their native
language. That's why ODBC cannot support (or badly supports) features that
are specific to a single DBMS system. Using a native driver, when
available, is absolutely preferred.
If your complaint is due to the fact that the only native implementation
for Gambas is the Mysql one, you have to understand that Mysql (usually in
the form of MariaDB) is available on all linux distributions and it is
free.
One other free DBMS available for all linuxes is Postgresql, but this is
not even nearly as widely used as Mysql. I would not be very surprised if,
in fact, the great majority of Gambas developers were using Mysql. What's
wrong with that?

Finally, a word about your "counting" problem. You never show the query you
need to do on your DBMS, but if you need a record count why don't you
simply issue a "SELECT COUNT(*) ..." on the db? Iterating over all the
records just to get a count doesn't seem like the best move... unless you
also need to do something on each record, obviously. Or am I missing
something?

Best regards
Cris


On Wed, May 17, 2017 at 6:54 PM, PICCORO McKAY Lenz <[hidden email]>
wrote:

> tobias, i answered few seconds, yeah the if was in wrong place.. thanks for
> the corrections..
>
> and u dont know that ODBC module in gambas does not implement or have same
> behaviour of the others like sqlite or mysql..
>
> count does not retunrs nothing, max neither so i must implement my own
> count..
>
> seems that mayority gambas develpoers only used mysql? nobody performs on
> mayor scalar DBMS ? oracle, sybase, postgresql?
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2017-05-17 12:32 GMT-04:00 Tobias Boege <[hidden email]>:
>
> > On Wed, 17 May 2017, PICCORO McKAY Lenz wrote:
> > > i try to filla gridview at demand, so due ODBC limitations i cannot
> count
> > > so inside my bean-like object i count and tehen return properties..
> > >
> > > the problem goes when i try to move to the fitrs record, i implement
> the
> > > code in wrong way? :
> > >
> > > Try resulobj = $conexionodbc.Exec(exisqueryrequest)
> > >
> > >   While (resulobj.Available)
> > >
> > >     If resulobj.MoveNext() Then
> > >       resulhowmany = resulhowmany + 1
> > >     Else
> > >       Break
> > >     Endif
> > >
> > >   Wend
> > >
> > >   resulobj.MoveFirst ' <--- here said that its foward only, that's true
> > if
> > > comes from a simple select ?
> > >
> >
> > I don't understand your last question (and I have no idea about bean-like
> > objects outside of gardening) but according to the Result.MoveNext()
> > documentation [1]:
> >
> >   Returns TRUE if the result is void or if there is no next record.
> >
> > You seem to increment your counter when the move *fails*, which will give
> > you a wrong count. I usually do something like:
> >
> >   ' Modifies the internal Result record pointer!
> >   Private Sub CountResult(hRes As Result) As Integer
> >     Dim iCount As Integer
> >
> >     If hRes.MoveFirst() Then Return 0
> >     iCount = 1
> >     While Not hRes.MoveNext()
> >       Inc iCount
> >     Wend
> >     Return iCount
> >   End
> >
> > Regards,
> > Tobi
> >
> > [1] http://gambaswiki.org/wiki/comp/gb.db/result/movenext
> >
> > --
> > "There's an old saying: Don't change anything... ever!" -- Mr. Monk
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

Tobias Boege-2
On Thu, 18 May 2017, Cristiano Guadagnino wrote:
> If your complaint is due to the fact that the only native implementation
> for Gambas is the Mysql one, you have to understand that Mysql (usually in
> the form of MariaDB) is available on all linux distributions and it is
> free.
> One other free DBMS available for all linuxes is Postgresql, but this is
> not even nearly as widely used as Mysql. I would not be very surprised if,
> in fact, the great majority of Gambas developers were using Mysql. What's
> wrong with that?
>

(Just a quick interjection: Gambas does have a native PostgreSQL driver.)

--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

PICCORO McKAY Lenz
In reply to this post by Cristiano Guadagnino
2017-05-17 18:31 GMT-04:00 Cristiano Guadagnino <[hidden email]>:


> If your complaint is due to the fact that the only native implementation
>
for Gambas is the Mysql one, you have to understand that Mysql (usually in
> the form of MariaDB) is available on all linux distributions and it is
> free.
> One other free DBMS available for all linuxes is Postgresql, but this is
> not even nearly as widely used as Mysql. I would not be very surprised if,
> in fact, the great majority of Gambas developers were using Mysql. What's
> wrong with that?
>
u miscunderstand the problem.. there's poor information about how to deal
with specific problems due are too many "famous commonly used"
implementations, i mean too many mysql+gambas combination and poor or less
odbc+gambas projects or odbc poor interes or support by the community

i mean, people here limit teir contributions.. i made important
contributions here, but not usefully for common use, by example everyone
used mysql.. so there's no interes!
many countries does not have enought resources to spend in solutions like
DB2 (very expensive) and b y the way i'm also a DB2 JEE senior.. and here a
manpower like hta are very expensive.. so jobs are very limited...


First of all, let me tell you that a big effort is needed to read you
> messages, because of your poor english and your writing style. I'm sorry if
> I'm a bit blunt, but please... a little effort from you would be very
> appreciated.
>
u have right, its due i not have enought time! implementing linux solutions
in a guindows only word its very hard.. and there's no commonly used
solutions.. time its required! and i confess, i really hate the english!


> Anyway, if your native language is spanish I would appreciate if, when
> speaking to me, you could add the spanish translation of your sentences...
> it would help me understand better. I am italian but I know spanish quite
> well.
>
i used older browser, and now google make mandatory "newer" browsers,
understand that not all the world have enough money to constant updates of
hardware due software requires every day more hardware! yeah its sad for me
and some others that not have internet to answer this quiestion like me!



>
> Finally, a word about your "counting" problem. You never show the query you
> need to do on your DBMS, but if you need a record count why don't you
> simply issue a "SELECT COUNT(*) ..." on the db? Iterating over all the
> records just to get a count doesn't seem like the best move... unless you
> also need to do something on each record, obviously. Or am I missing
> something?
>
i cannot do SELECT COUNT and the select its a dinamyc example that table
only exist by 20 minutes.. and if u ask about why: must be a table, must
not be temporally, must no be a file, must not be partitioned in sybhase,
must be simple to consult (i mean a simple select) and must be understand
by novices, due money



>
> Best regards
> Cris
>
>
> On Wed, May 17, 2017 at 6:54 PM, PICCORO McKAY Lenz <
> [hidden email]>
> wrote:
>
> > tobias, i answered few seconds, yeah the if was in wrong place.. thanks
> for
> > the corrections..
> >
> > and u dont know that ODBC module in gambas does not implement or have
> same
> > behaviour of the others like sqlite or mysql..
> >
> > count does not retunrs nothing, max neither so i must implement my own
> > count..
> >
> > seems that mayority gambas develpoers only used mysql? nobody performs on
> > mayor scalar DBMS ? oracle, sybase, postgresql?
> >
> > Lenz McKAY Gerardo (PICCORO)
> > http://qgqlochekone.blogspot.com
> >
> > 2017-05-17 12:32 GMT-04:00 Tobias Boege <[hidden email]>:
> >
> > > On Wed, 17 May 2017, PICCORO McKAY Lenz wrote:
> > > > i try to filla gridview at demand, so due ODBC limitations i cannot
> > count
> > > > so inside my bean-like object i count and tehen return properties..
> > > >
> > > > the problem goes when i try to move to the fitrs record, i implement
> > the
> > > > code in wrong way? :
> > > >
> > > > Try resulobj = $conexionodbc.Exec(exisqueryrequest)
> > > >
> > > >   While (resulobj.Available)
> > > >
> > > >     If resulobj.MoveNext() Then
> > > >       resulhowmany = resulhowmany + 1
> > > >     Else
> > > >       Break
> > > >     Endif
> > > >
> > > >   Wend
> > > >
> > > >   resulobj.MoveFirst ' <--- here said that its foward only, that's
> true
> > > if
> > > > comes from a simple select ?
> > > >
> > >
> > > I don't understand your last question (and I have no idea about
> bean-like
> > > objects outside of gardening) but according to the Result.MoveNext()
> > > documentation [1]:
> > >
> > >   Returns TRUE if the result is void or if there is no next record.
> > >
> > > You seem to increment your counter when the move *fails*, which will
> give
> > > you a wrong count. I usually do something like:
> > >
> > >   ' Modifies the internal Result record pointer!
> > >   Private Sub CountResult(hRes As Result) As Integer
> > >     Dim iCount As Integer
> > >
> > >     If hRes.MoveFirst() Then Return 0
> > >     iCount = 1
> > >     While Not hRes.MoveNext()
> > >       Inc iCount
> > >     Wend
> > >     Return iCount
> > >   End
> > >
> > > Regards,
> > > Tobi
> > >
> > > [1] http://gambaswiki.org/wiki/comp/gb.db/result/movenext
> > >
> > > --
> > > "There's an old saying: Don't change anything... ever!" -- Mr. Monk
> > >
> > > ------------------------------------------------------------
> > > ------------------
> > > Check out the vibrant tech community on one of the world's most
> > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > > _______________________________________________
> > > Gambas-user mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

PICCORO McKAY Lenz
In reply to this post by Tobias Boege-2
yes tobias, I already know.- in last years some bugs where discovered by me
... the surprise its that those bugs were inside gambas since some time ..
that's probe that the usage of was very few and limited .. (i mean too many
mysql )

but now i can not use, the corporation now used odbc for standard and
gundows integration ... so i must use odbc inclusivelly for mysql !!! Arrggg

so now i implement your solution, and recors fill the grid .. but when i
separate the database logic from the form .. now the recorset gives me the
"only forward" error ...

i try to attadhed the project example ... some one can helpme? the mail
list cut the message! i cannot attach project!

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-05-17 18:49 GMT-04:00 Tobias Boege <[hidden email]>:

> On Thu, 18 May 2017, Cristiano Guadagnino wrote:
> > If your complaint is due to the fact that the only native implementation
> > for Gambas is the Mysql one, you have to understand that Mysql (usually
> in
> > the form of MariaDB) is available on all linux distributions and it is
> > free.
> > One other free DBMS available for all linuxes is Postgresql, but this is
> > not even nearly as widely used as Mysql. I would not be very surprised
> if,
> > in fact, the great majority of Gambas developers were using Mysql. What's
> > wrong with that?
> >
>
> (Just a quick interjection: Gambas does have a native PostgreSQL driver.)
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

Fabien Bodard-4
2017-05-18 17:13 GMT+02:00 PICCORO McKAY Lenz <[hidden email]>:

> yes tobias, I already know.- in last years some bugs where discovered by me
> ... the surprise its that those bugs were inside gambas since some time ..
> that's probe that the usage of was very few and limited .. (i mean too many
> mysql )
>
> but now i can not use, the corporation now used odbc for standard and
> gundows integration ... so i must use odbc inclusivelly for mysql !!! Arrggg
>
> so now i implement your solution, and recors fill the grid .. but when i
> separate the database logic from the form .. now the recorset gives me the
> "only forward" error ...
>
> i try to attadhed the project example ... some one can helpme? the mail
> list cut the message! i cannot attach project!

send it to me :

[hidden email]

>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2017-05-17 18:49 GMT-04:00 Tobias Boege <[hidden email]>:
>
>> On Thu, 18 May 2017, Cristiano Guadagnino wrote:
>> > If your complaint is due to the fact that the only native implementation
>> > for Gambas is the Mysql one, you have to understand that Mysql (usually
>> in
>> > the form of MariaDB) is available on all linux distributions and it is
>> > free.
>> > One other free DBMS available for all linuxes is Postgresql, but this is
>> > not even nearly as widely used as Mysql. I would not be very surprised
>> if,
>> > in fact, the great majority of Gambas developers were using Mysql. What's
>> > wrong with that?
>> >
>>
>> (Just a quick interjection: Gambas does have a native PostgreSQL driver.)
>>
>> --
>> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user



--
Fabien Bodard

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

PICCORO McKAY Lenz
now after some messaged between fabian and me, i continue in the list the
problemm

thanks fabian.. do you see that moveto do not permit due the grid does not
fill in order.. so when the data event are raised the index are not
secuencial so a "foward only" problem happened....

and now u count and then send again the select:


  $Result = db.Exec("select count(*) irows from sys_productos")
  $iCount = $Result!irows

  $Result = db.Exec("select * from sys_productos") <- in sybase odbc seems
this does not work afete a count using select


seems there's a problem in odbc, this was i do in firts, but does not work,
maybe i do in bad way..

due right now i not have the odbc environment.. i'll test monday and post
feedback here.. but seems the odbc module in gambas has a problem in this
way, due does not permit make that.. or at least does not permit retrieve
the results after made a select count


Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-05-19 2:59 GMT-04:30 Fabien Bodard <[hidden email]>:

> 2017-05-18 17:13 GMT+02:00 PICCORO McKAY Lenz <[hidden email]>:
> > yes tobias, I already know.- in last years some bugs where discovered by
> me
> > ... the surprise its that those bugs were inside gambas since some time
> ..
> > that's probe that the usage of was very few and limited .. (i mean too
> many
> > mysql )
> >
> > but now i can not use, the corporation now used odbc for standard and
> > gundows integration ... so i must use odbc inclusivelly for mysql !!!
> Arrggg
> >
> > so now i implement your solution, and recors fill the grid .. but when i
> > separate the database logic from the form .. now the recorset gives me
> the
> > "only forward" error ...
> >
> > i try to attadhed the project example ... some one can helpme? the mail
> > list cut the message! i cannot attach project!
>
> send it to me :
>
> [hidden email]
> >
> > Lenz McKAY Gerardo (PICCORO)
> > http://qgqlochekone.blogspot.com
> >
> > 2017-05-17 18:49 GMT-04:00 Tobias Boege <[hidden email]>:
> >
> >> On Thu, 18 May 2017, Cristiano Guadagnino wrote:
> >> > If your complaint is due to the fact that the only native
> implementation
> >> > for Gambas is the Mysql one, you have to understand that Mysql
> (usually
> >> in
> >> > the form of MariaDB) is available on all linux distributions and it is
> >> > free.
> >> > One other free DBMS available for all linuxes is Postgresql, but this
> is
> >> > not even nearly as widely used as Mysql. I would not be very surprised
> >> if,
> >> > in fact, the great majority of Gambas developers were using Mysql.
> What's
> >> > wrong with that?
> >> >
> >>
> >> (Just a quick interjection: Gambas does have a native PostgreSQL
> driver.)
> >>
> >> --
> >> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
> >>
> >> ------------------------------------------------------------
> >> ------------------
> >> Check out the vibrant tech community on one of the world's most
> >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> >> _______________________________________________
> >> Gambas-user mailing list
> >> [hidden email]
> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
> >>
> > ------------------------------------------------------------
> ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
> --
> Fabien Bodard
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

zxMarce
Piccoro,

All .MoveXXX methods except .MoveNext need a record count from the provider. You know that ODBC does not provide one, but some drivers do, and I also patched the component to try to fetch this count when possible.

Now, the driver may NOT be correctly configured in unixODBC, allowing some issues. For example, if I use FreeTDS with a Server_Version of 7.0 and try to connect to a MSSQL2005, the compinent will not be able to fetch rec counts even with the patch I mentioned. But if I just change the Server_Version to 7.2, voilà: I get record counts via the patch.

This is because FreeTDS will not allow (nor ODBC will emulate) cursors with the first version combination. But it will with the second.  Cursors is what enable a result set to skip back and forth. The patch simply remembers where the cursor is (if it exists), then jumps to the last record and fetches its ordinal; then it goes back to where it was originally, and returns the record count. But for all this to work both ODBC and the driver must somehow support cursors, either by design or emulated.

If you use the component test project I attached to one of your bug reports, enable GB.Debug and try your connection string (for these tests it's  best to try connstrings so you don't have to edit INIs like crazy just to test), the console will tell you whether cursors are present or not.

Bear in mind that it is possible to have cursors available but not a proper Gambas RecordCount though.

Hope it helps,
zxMarce.


On May 21, 2017, 12:41, at 12:41, PICCORO McKAY Lenz <[hidden email]> wrote:

>now after some messaged between fabian and me, i continue in the list
>the
>problemm
>
>thanks fabian.. do you see that moveto do not permit due the grid does
>not
>fill in order.. so when the data event are raised the index are not
>secuencial so a "foward only" problem happened....
>
>and now u count and then send again the select:
>
>
>  $Result = db.Exec("select count(*) irows from sys_productos")
>  $iCount = $Result!irows
>
>$Result = db.Exec("select * from sys_productos") <- in sybase odbc
>seems
>this does not work afete a count using select
>
>
>seems there's a problem in odbc, this was i do in firts, but does not
>work,
>maybe i do in bad way..
>
>due right now i not have the odbc environment.. i'll test monday and
>post
>feedback here.. but seems the odbc module in gambas has a problem in
>this
>way, due does not permit make that.. or at least does not permit
>retrieve
>the results after made a select count
>
>
>Lenz McKAY Gerardo (PICCORO)
>http://qgqlochekone.blogspot.com
>
>2017-05-19 2:59 GMT-04:30 Fabien Bodard <[hidden email]>:
>
>> 2017-05-18 17:13 GMT+02:00 PICCORO McKAY Lenz
><[hidden email]>:
>> > yes tobias, I already know.- in last years some bugs where
>discovered by
>> me
>> > ... the surprise its that those bugs were inside gambas since some
>time
>> ..
>> > that's probe that the usage of was very few and limited .. (i mean
>too
>> many
>> > mysql )
>> >
>> > but now i can not use, the corporation now used odbc for standard
>and
>> > gundows integration ... so i must use odbc inclusivelly for mysql
>!!!
>> Arrggg
>> >
>> > so now i implement your solution, and recors fill the grid .. but
>when i
>> > separate the database logic from the form .. now the recorset gives
>me
>> the
>> > "only forward" error ...
>> >
>> > i try to attadhed the project example ... some one can helpme? the
>mail
>> > list cut the message! i cannot attach project!
>>
>> send it to me :
>>
>> [hidden email]
>> >
>> > Lenz McKAY Gerardo (PICCORO)
>> > http://qgqlochekone.blogspot.com
>> >
>> > 2017-05-17 18:49 GMT-04:00 Tobias Boege <[hidden email]>:
>> >
>> >> On Thu, 18 May 2017, Cristiano Guadagnino wrote:
>> >> > If your complaint is due to the fact that the only native
>> implementation
>> >> > for Gambas is the Mysql one, you have to understand that Mysql
>> (usually
>> >> in
>> >> > the form of MariaDB) is available on all linux distributions and
>it is
>> >> > free.
>> >> > One other free DBMS available for all linuxes is Postgresql, but
>this
>> is
>> >> > not even nearly as widely used as Mysql. I would not be very
>surprised
>> >> if,
>> >> > in fact, the great majority of Gambas developers were using
>Mysql.
>> What's
>> >> > wrong with that?
>> >> >
>> >>
>> >> (Just a quick interjection: Gambas does have a native PostgreSQL
>> driver.)
>> >>
>> >> --
>> >> "There's an old saying: Don't change anything... ever!" -- Mr.
>Monk
>> >>
>> >> ------------------------------------------------------------
>> >> ------------------
>> >> Check out the vibrant tech community on one of the world's most
>> >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> >> _______________________________________________
>> >> Gambas-user mailing list
>> >> [hidden email]
>> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >>
>> > ------------------------------------------------------------
>> ------------------
>> > Check out the vibrant tech community on one of the world's most
>> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> > _______________________________________________
>> > Gambas-user mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>>
>>
>> --
>> Fabien Bodard
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>------------------------------------------------------------------------------
>Check out the vibrant tech community on one of the world's most
>engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>_______________________________________________
>Gambas-user mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

PICCORO McKAY Lenz
2017-05-21 12:33 GMT-04:30 <[hidden email]>:

> All .MoveXXX methods except .MoveNext need a record count from the
> provider. You know that ODBC does not provide one, but some drivers do, and
> I also patched the component to try to fetch this count when possible.
>
> Now, the driver may NOT be correctly configured in unixODBC, allowing some
> issues. For example, if I use FreeTDS with a Server_Version of 7.0 and try
> to connect to a MSSQL2005, the compinent will not be able to fetch rec
> counts even with the patch I mentioned. But if I just change the
> Server_Version to 7.2, voilà: I get record counts via the patch.
>
umm but seems based on your info, i never will get the requireds for made
it by that way! for sybae freetds internally always use the 5.0 version
protocol


> This is because FreeTDS will not allow (nor ODBC will emulate) cursors
> with the first version combination. But it will with the second.  Cursors
> is what enable a result set to skip back and forth. The patch simply
> remembers where the cursor is (if it exists), then jumps to the last record
> and fetches its ordinal; then it goes back to where it was originally, and
> returns the record count. But for all this to work both ODBC and the driver
> must somehow support cursors, either by design or emulated.
>
ok as i said, i never will get the requireds by that way! sybase need the
5.0 protocol and any other version server protocol will break the usage


> If you use the component test project I attached to one of your bug
> reports, enable GB.Debug and try your connection string (for these tests
> it's  best to try connstrings so you don't have to edit INIs like crazy
> just to test),

the ini file its crated dinamically i dont have problem


> the console will tell you whether cursors are present or not.
>
thanks for the info.. but based in the info of firts paragraph seems that
by that way will never get the required!


>
> Bear in mind that it is possible to have cursors available but not a
> proper Gambas RecordCount though.
>
really? that 's contrary to the explained in the previous paragraphs!!..
but have logic!
umm but the record count will not be there for the fill of the grid! i will
debug like u sugested and try it! but seems due freetds server version 5.0
protocol i'll not get so much.. sybase only used protocol 5.0 server
version..


thanks for help zxMarce and Fabian, i'm very impatient  monday comes, to
test in proper environment.. in my eeepc 2G there's no enough space for do
any of..

ah?, yeah i writing this main in a very older hardware! with only 2G of
disk and 512 of ram.. running Chronno Trigger in pxsc using debian squeeze


>
> Hope it helps,
> zxMarce.
>
>
> On May 21, 2017, 12:41, at 12:41, PICCORO McKAY Lenz <
> [hidden email]> wrote:
> >now after some messaged between fabian and me, i continue in the list
> >the
> >problemm
> >
> >thanks fabian.. do you see that moveto do not permit due the grid does
> >not
> >fill in order.. so when the data event are raised the index are not
> >secuencial so a "foward only" problem happened....
> >
> >and now u count and then send again the select:
> >
> >
> >  $Result = db.Exec("select count(*) irows from sys_productos")
> >  $iCount = $Result!irows
> >
> >$Result = db.Exec("select * from sys_productos") <- in sybase odbc
> >seems
> >this does not work afete a count using select
> >
> >
> >seems there's a problem in odbc, this was i do in firts, but does not
> >work,
> >maybe i do in bad way..
> >
> >due right now i not have the odbc environment.. i'll test monday and
> >post
> >feedback here.. but seems the odbc module in gambas has a problem in
> >this
> >way, due does not permit make that.. or at least does not permit
> >retrieve
> >the results after made a select count
> >
> >
> >Lenz McKAY Gerardo (PICCORO)
> >http://qgqlochekone.blogspot.com
> >
> >2017-05-19 2:59 GMT-04:30 Fabien Bodard <[hidden email]>:
> >
> >> 2017-05-18 17:13 GMT+02:00 PICCORO McKAY Lenz
> ><[hidden email]>:
> >> > yes tobias, I already know.- in last years some bugs where
> >discovered by
> >> me
> >> > ... the surprise its that those bugs were inside gambas since some
> >time
> >> ..
> >> > that's probe that the usage of was very few and limited .. (i mean
> >too
> >> many
> >> > mysql )
> >> >
> >> > but now i can not use, the corporation now used odbc for standard
> >and
> >> > gundows integration ... so i must use odbc inclusivelly for mysql
> >!!!
> >> Arrggg
> >> >
> >> > so now i implement your solution, and recors fill the grid .. but
> >when i
> >> > separate the database logic from the form .. now the recorset gives
> >me
> >> the
> >> > "only forward" error ...
> >> >
> >> > i try to attadhed the project example ... some one can helpme? the
> >mail
> >> > list cut the message! i cannot attach project!
> >>
> >> send it to me :
> >>
> >> [hidden email]
> >> >
> >> > Lenz McKAY Gerardo (PICCORO)
> >> > http://qgqlochekone.blogspot.com
> >> >
> >> > 2017-05-17 18:49 GMT-04:00 Tobias Boege <[hidden email]>:
> >> >
> >> >> On Thu, 18 May 2017, Cristiano Guadagnino wrote:
> >> >> > If your complaint is due to the fact that the only native
> >> implementation
> >> >> > for Gambas is the Mysql one, you have to understand that Mysql
> >> (usually
> >> >> in
> >> >> > the form of MariaDB) is available on all linux distributions and
> >it is
> >> >> > free.
> >> >> > One other free DBMS available for all linuxes is Postgresql, but
> >this
> >> is
> >> >> > not even nearly as widely used as Mysql. I would not be very
> >surprised
> >> >> if,
> >> >> > in fact, the great majority of Gambas developers were using
> >Mysql.
> >> What's
> >> >> > wrong with that?
> >> >> >
> >> >>
> >> >> (Just a quick interjection: Gambas does have a native PostgreSQL
> >> driver.)
> >> >>
> >> >> --
> >> >> "There's an old saying: Don't change anything... ever!" -- Mr.
> >Monk
> >> >>
> >> >> ------------------------------------------------------------
> >> >> ------------------
> >> >> Check out the vibrant tech community on one of the world's most
> >> >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> >> >> _______________________________________________
> >> >> Gambas-user mailing list
> >> >> [hidden email]
> >> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
> >> >>
> >> > ------------------------------------------------------------
> >> ------------------
> >> > Check out the vibrant tech community on one of the world's most
> >> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> >> > _______________________________________________
> >> > Gambas-user mailing list
> >> > [hidden email]
> >> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >>
> >>
> >>
> >> --
> >> Fabien Bodard
> >>
> >> ------------------------------------------------------------
> >> ------------------
> >> Check out the vibrant tech community on one of the world's most
> >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> >> _______________________________________________
> >> Gambas-user mailing list
> >> [hidden email]
> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
> >>
> >-----------------------------------------------------------
> -------------------
> >Check out the vibrant tech community on one of the world's most
> >engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> >_______________________________________________
> >Gambas-user mailing list
> >[hidden email]
> >https://lists.sourceforge.net/lists/listinfo/gambas-user
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

PICCORO McKAY Lenz
hello Fabian.. hello zxMarce

Fabian, your method/code does not work as zxMarce said.. (in any case, the
resultset and db manage was done in form code)

due the result object to make the MoveTo need the count for...  as said
zxMarce all .MoveXXX methods except .MoveNext SEEMS need a record count
from the provider. so there's no way for the DAta event to fill the grid
using ODBC and sybase...

1) this kind of information MUST BE in the documentation Benoit
2) the odbc standard does not have that unless a INSERT, UPDATE or DELETE
was done

Now lest try with the second suggestion .. a patched.. may not work either,
due seems (and here i dont know or i not debug well) ODBC does not permit
subquerys if a recorset are still open..

all the code will must go to the odbc gambas implementation due by example
if i do:

select count(codigo) as cuanto from dba.ta_sys_existencias_dinamicas order
by cuanto limit 50000 offset 0

and in other result i do

select * from dba.ta_sys_existencias_dinamicas order by col1 limit 50000
offset 0

take in consideration the limit indicate only 50000 rows, the odbc does not
report the amount , but due strange reasons, the where( rs.available) will
iterate over the 50000 rows event the count select only return one row!

so in conclusion.. the only way to fill the grid for now, in gambas using
odbc basic implementation its manually secuencial starting from 0 ending in
a manual count over the previously iteration..

seem quite complicated to explain and its not documented in any place in
wiki..

i can documented but only in spanish.. i'm tyred of english only!

NOTE IMPORTAT: i must duplicate all this info in the respective bug  due
the buggy integration between gambas list and mail bugtraker

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-05-21 15:46 GMT-04:00 PICCORO McKAY Lenz <[hidden email]>:

> 2017-05-21 12:33 GMT-04:30 <[hidden email]>:
>
>> All .MoveXXX methods except .MoveNext need a record count from the
>> provider. You know that ODBC does not provide one, but some drivers do, and
>> I also patched the component to try to fetch this count when possible.
>>
>> Now, the driver may NOT be correctly configured in unixODBC, allowing
>> some issues. For example, if I use FreeTDS with a Server_Version of 7.0 and
>> try to connect to a MSSQL2005, the compinent will not be able to fetch rec
>> counts even with the patch I mentioned. But if I just change the
>> Server_Version to 7.2, voilà: I get record counts via the patch.
>>
> umm but seems based on your info, i never will get the requireds for made
> it by that way! for sybae freetds internally always use the 5.0 version
> protocol
>
>
>> This is because FreeTDS will not allow (nor ODBC will emulate) cursors
>> with the first version combination. But it will with the second.  Cursors
>> is what enable a result set to skip back and forth. The patch simply
>> remembers where the cursor is (if it exists), then jumps to the last record
>> and fetches its ordinal; then it goes back to where it was originally, and
>> returns the record count. But for all this to work both ODBC and the driver
>> must somehow support cursors, either by design or emulated.
>>
> ok as i said, i never will get the requireds by that way! sybase need the
> 5.0 protocol and any other version server protocol will break the usage
>
>
>> If you use the component test project I attached to one of your bug
>> reports, enable GB.Debug and try your connection string (for these tests
>> it's  best to try connstrings so you don't have to edit INIs like crazy
>> just to test),
>
> the ini file its crated dinamically i dont have problem
>
>
>> the console will tell you whether cursors are present or not.
>>
> thanks for the info.. but based in the info of firts paragraph seems that
> by that way will never get the required!
>
>
>>
>> Bear in mind that it is possible to have cursors available but not a
>> proper Gambas RecordCount though.
>>
> really? that 's contrary to the explained in the previous paragraphs!!..
> but have logic!
> umm but the record count will not be there for the fill of the grid! i
> will debug like u sugested and try it! but seems due freetds server version
> 5.0 protocol i'll not get so much.. sybase only used protocol 5.0 server
> version..
>
>
> thanks for help zxMarce and Fabian, i'm very impatient  monday comes, to
> test in proper environment.. in my eeepc 2G there's no enough space for do
> any of..
>
> ah?, yeah i writing this main in a very older hardware! with only 2G of
> disk and 512 of ram.. running Chronno Trigger in pxsc using debian squeeze
>
>
>>
>> Hope it helps,
>> zxMarce.
>>
>>
>> On May 21, 2017, 12:41, at 12:41, PICCORO McKAY Lenz <
>> [hidden email]> wrote:
>> >now after some messaged between fabian and me, i continue in the list
>> >the
>> >problemm
>> >
>> >thanks fabian.. do you see that moveto do not permit due the grid does
>> >not
>> >fill in order.. so when the data event are raised the index are not
>> >secuencial so a "foward only" problem happened....
>> >
>> >and now u count and then send again the select:
>> >
>> >
>> >  $Result = db.Exec("select count(*) irows from sys_productos")
>> >  $iCount = $Result!irows
>> >
>> >$Result = db.Exec("select * from sys_productos") <- in sybase odbc
>> >seems
>> >this does not work afete a count using select
>> >
>> >
>> >seems there's a problem in odbc, this was i do in firts, but does not
>> >work,
>> >maybe i do in bad way..
>> >
>> >due right now i not have the odbc environment.. i'll test monday and
>> >post
>> >feedback here.. but seems the odbc module in gambas has a problem in
>> >this
>> >way, due does not permit make that.. or at least does not permit
>> >retrieve
>> >the results after made a select count
>> >
>> >
>> >Lenz McKAY Gerardo (PICCORO)
>> >http://qgqlochekone.blogspot.com
>> >
>> >2017-05-19 2:59 GMT-04:30 Fabien Bodard <[hidden email]>:
>> >
>> >> 2017-05-18 17:13 GMT+02:00 PICCORO McKAY Lenz
>> ><[hidden email]>:
>> >> > yes tobias, I already know.- in last years some bugs where
>> >discovered by
>> >> me
>> >> > ... the surprise its that those bugs were inside gambas since some
>> >time
>> >> ..
>> >> > that's probe that the usage of was very few and limited .. (i mean
>> >too
>> >> many
>> >> > mysql )
>> >> >
>> >> > but now i can not use, the corporation now used odbc for standard
>> >and
>> >> > gundows integration ... so i must use odbc inclusivelly for mysql
>> >!!!
>> >> Arrggg
>> >> >
>> >> > so now i implement your solution, and recors fill the grid .. but
>> >when i
>> >> > separate the database logic from the form .. now the recorset gives
>> >me
>> >> the
>> >> > "only forward" error ...
>> >> >
>> >> > i try to attadhed the project example ... some one can helpme? the
>> >mail
>> >> > list cut the message! i cannot attach project!
>> >>
>> >> send it to me :
>> >>
>> >> [hidden email]
>> >> >
>> >> > Lenz McKAY Gerardo (PICCORO)
>> >> > http://qgqlochekone.blogspot.com
>> >> >
>> >> > 2017-05-17 18:49 GMT-04:00 Tobias Boege <[hidden email]>:
>> >> >
>> >> >> On Thu, 18 May 2017, Cristiano Guadagnino wrote:
>> >> >> > If your complaint is due to the fact that the only native
>> >> implementation
>> >> >> > for Gambas is the Mysql one, you have to understand that Mysql
>> >> (usually
>> >> >> in
>> >> >> > the form of MariaDB) is available on all linux distributions and
>> >it is
>> >> >> > free.
>> >> >> > One other free DBMS available for all linuxes is Postgresql, but
>> >this
>> >> is
>> >> >> > not even nearly as widely used as Mysql. I would not be very
>> >surprised
>> >> >> if,
>> >> >> > in fact, the great majority of Gambas developers were using
>> >Mysql.
>> >> What's
>> >> >> > wrong with that?
>> >> >> >
>> >> >>
>> >> >> (Just a quick interjection: Gambas does have a native PostgreSQL
>> >> driver.)
>> >> >>
>> >> >> --
>> >> >> "There's an old saying: Don't change anything... ever!" -- Mr.
>> >Monk
>> >> >>
>> >> >> ------------------------------------------------------------
>> >> >> ------------------
>> >> >> Check out the vibrant tech community on one of the world's most
>> >> >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> >> >> _______________________________________________
>> >> >> Gambas-user mailing list
>> >> >> [hidden email]
>> >> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >> >>
>> >> > ------------------------------------------------------------
>> >> ------------------
>> >> > Check out the vibrant tech community on one of the world's most
>> >> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> >> > _______________________________________________
>> >> > Gambas-user mailing list
>> >> > [hidden email]
>> >> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >>
>> >>
>> >>
>> >> --
>> >> Fabien Bodard
>> >>
>> >> ------------------------------------------------------------
>> >> ------------------
>> >> Check out the vibrant tech community on one of the world's most
>> >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> >> _______________________________________________
>> >> Gambas-user mailing list
>> >> [hidden email]
>> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >>
>> >-----------------------------------------------------------
>> -------------------
>> >Check out the vibrant tech community on one of the world's most
>> >engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> >_______________________________________________
>> >Gambas-user mailing list
>> >[hidden email]
>> >https://lists.sourceforge.net/lists/listinfo/gambas-user
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: result from select can be movefirts from ODBC?

PICCORO McKAY Lenz
hi zxMarce debuggin i note that based on their documentation, inserts must
return affected roms and seems gambas odbc object does not made this..

please illuminate me! i made a odbc inserts and either returns affected
roms! some other has same results?

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-05-22 9:21 GMT-04:00 PICCORO McKAY Lenz <[hidden email]>:

> hello Fabian.. hello zxMarce
>
> Fabian, your method/code does not work as zxMarce said.. (in any case, the
> resultset and db manage was done in form code)
>
> due the result object to make the MoveTo need the count for...  as said
> zxMarce all .MoveXXX methods except .MoveNext SEEMS need a record count
> from the provider. so there's no way for the DAta event to fill the grid
> using ODBC and sybase...
>
> 1) this kind of information MUST BE in the documentation Benoit
> 2) the odbc standard does not have that unless a INSERT, UPDATE or DELETE
> was done
>
> Now lest try with the second suggestion .. a patched.. may not work
> either, due seems (and here i dont know or i not debug well) ODBC does not
> permit subquerys if a recorset are still open..
>
> all the code will must go to the odbc gambas implementation due by example
> if i do:
>
> select count(codigo) as cuanto from dba.ta_sys_existencias_dinamicas
> order by cuanto limit 50000 offset 0
>
> and in other result i do
>
> select * from dba.ta_sys_existencias_dinamicas order by col1 limit 50000
> offset 0
>
> take in consideration the limit indicate only 50000 rows, the odbc does
> not report the amount , but due strange reasons, the where( rs.available)
> will iterate over the 50000 rows event the count select only return one row!
>
> so in conclusion.. the only way to fill the grid for now, in gambas using
> odbc basic implementation its manually secuencial starting from 0 ending in
> a manual count over the previously iteration..
>
> seem quite complicated to explain and its not documented in any place in
> wiki..
>
> i can documented but only in spanish.. i'm tyred of english only!
>
> NOTE IMPORTAT: i must duplicate all this info in the respective bug  due
> the buggy integration between gambas list and mail bugtraker
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2017-05-21 15:46 GMT-04:00 PICCORO McKAY Lenz <[hidden email]>:
>
>> 2017-05-21 12:33 GMT-04:30 <[hidden email]>:
>>
>>> All .MoveXXX methods except .MoveNext need a record count from the
>>> provider. You know that ODBC does not provide one, but some drivers do, and
>>> I also patched the component to try to fetch this count when possible.
>>>
>>> Now, the driver may NOT be correctly configured in unixODBC, allowing
>>> some issues. For example, if I use FreeTDS with a Server_Version of 7.0 and
>>> try to connect to a MSSQL2005, the compinent will not be able to fetch rec
>>> counts even with the patch I mentioned. But if I just change the
>>> Server_Version to 7.2, voilà: I get record counts via the patch.
>>>
>> umm but seems based on your info, i never will get the requireds for made
>> it by that way! for sybae freetds internally always use the 5.0 version
>> protocol
>>
>>
>>> This is because FreeTDS will not allow (nor ODBC will emulate) cursors
>>> with the first version combination. But it will with the second.  Cursors
>>> is what enable a result set to skip back and forth. The patch simply
>>> remembers where the cursor is (if it exists), then jumps to the last record
>>> and fetches its ordinal; then it goes back to where it was originally, and
>>> returns the record count. But for all this to work both ODBC and the driver
>>> must somehow support cursors, either by design or emulated.
>>>
>> ok as i said, i never will get the requireds by that way! sybase need the
>> 5.0 protocol and any other version server protocol will break the usage
>>
>>
>>> If you use the component test project I attached to one of your bug
>>> reports, enable GB.Debug and try your connection string (for these tests
>>> it's  best to try connstrings so you don't have to edit INIs like crazy
>>> just to test),
>>
>> the ini file its crated dinamically i dont have problem
>>
>>
>>> the console will tell you whether cursors are present or not.
>>>
>> thanks for the info.. but based in the info of firts paragraph seems that
>> by that way will never get the required!
>>
>>
>>>
>>> Bear in mind that it is possible to have cursors available but not a
>>> proper Gambas RecordCount though.
>>>
>> really? that 's contrary to the explained in the previous paragraphs!!..
>> but have logic!
>> umm but the record count will not be there for the fill of the grid! i
>> will debug like u sugested and try it! but seems due freetds server version
>> 5.0 protocol i'll not get so much.. sybase only used protocol 5.0 server
>> version..
>>
>>
>> thanks for help zxMarce and Fabian, i'm very impatient  monday comes, to
>> test in proper environment.. in my eeepc 2G there's no enough space for do
>> any of..
>>
>> ah?, yeah i writing this main in a very older hardware! with only 2G of
>> disk and 512 of ram.. running Chronno Trigger in pxsc using debian squeeze
>>
>>
>>>
>>> Hope it helps,
>>> zxMarce.
>>>
>>>
>>> On May 21, 2017, 12:41, at 12:41, PICCORO McKAY Lenz <
>>> [hidden email]> wrote:
>>> >now after some messaged between fabian and me, i continue in the list
>>> >the
>>> >problemm
>>> >
>>> >thanks fabian.. do you see that moveto do not permit due the grid does
>>> >not
>>> >fill in order.. so when the data event are raised the index are not
>>> >secuencial so a "foward only" problem happened....
>>> >
>>> >and now u count and then send again the select:
>>> >
>>> >
>>> >  $Result = db.Exec("select count(*) irows from sys_productos")
>>> >  $iCount = $Result!irows
>>> >
>>> >$Result = db.Exec("select * from sys_productos") <- in sybase odbc
>>> >seems
>>> >this does not work afete a count using select
>>> >
>>> >
>>> >seems there's a problem in odbc, this was i do in firts, but does not
>>> >work,
>>> >maybe i do in bad way..
>>> >
>>> >due right now i not have the odbc environment.. i'll test monday and
>>> >post
>>> >feedback here.. but seems the odbc module in gambas has a problem in
>>> >this
>>> >way, due does not permit make that.. or at least does not permit
>>> >retrieve
>>> >the results after made a select count
>>> >
>>> >
>>> >Lenz McKAY Gerardo (PICCORO)
>>> >http://qgqlochekone.blogspot.com
>>> >
>>> >2017-05-19 2:59 GMT-04:30 Fabien Bodard <[hidden email]>:
>>> >
>>> >> 2017-05-18 17:13 GMT+02:00 PICCORO McKAY Lenz
>>> ><[hidden email]>:
>>> >> > yes tobias, I already know.- in last years some bugs where
>>> >discovered by
>>> >> me
>>> >> > ... the surprise its that those bugs were inside gambas since some
>>> >time
>>> >> ..
>>> >> > that's probe that the usage of was very few and limited .. (i mean
>>> >too
>>> >> many
>>> >> > mysql )
>>> >> >
>>> >> > but now i can not use, the corporation now used odbc for standard
>>> >and
>>> >> > gundows integration ... so i must use odbc inclusivelly for mysql
>>> >!!!
>>> >> Arrggg
>>> >> >
>>> >> > so now i implement your solution, and recors fill the grid .. but
>>> >when i
>>> >> > separate the database logic from the form .. now the recorset gives
>>> >me
>>> >> the
>>> >> > "only forward" error ...
>>> >> >
>>> >> > i try to attadhed the project example ... some one can helpme? the
>>> >mail
>>> >> > list cut the message! i cannot attach project!
>>> >>
>>> >> send it to me :
>>> >>
>>> >> [hidden email]
>>> >> >
>>> >> > Lenz McKAY Gerardo (PICCORO)
>>> >> > http://qgqlochekone.blogspot.com
>>> >> >
>>> >> > 2017-05-17 18:49 GMT-04:00 Tobias Boege <[hidden email]>:
>>> >> >
>>> >> >> On Thu, 18 May 2017, Cristiano Guadagnino wrote:
>>> >> >> > If your complaint is due to the fact that the only native
>>> >> implementation
>>> >> >> > for Gambas is the Mysql one, you have to understand that Mysql
>>> >> (usually
>>> >> >> in
>>> >> >> > the form of MariaDB) is available on all linux distributions and
>>> >it is
>>> >> >> > free.
>>> >> >> > One other free DBMS available for all linuxes is Postgresql, but
>>> >this
>>> >> is
>>> >> >> > not even nearly as widely used as Mysql. I would not be very
>>> >surprised
>>> >> >> if,
>>> >> >> > in fact, the great majority of Gambas developers were using
>>> >Mysql.
>>> >> What's
>>> >> >> > wrong with that?
>>> >> >> >
>>> >> >>
>>> >> >> (Just a quick interjection: Gambas does have a native PostgreSQL
>>> >> driver.)
>>> >> >>
>>> >> >> --
>>> >> >> "There's an old saying: Don't change anything... ever!" -- Mr.
>>> >Monk
>>> >> >>
>>> >> >> ------------------------------------------------------------
>>> >> >> ------------------
>>> >> >> Check out the vibrant tech community on one of the world's most
>>> >> >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> >> >> _______________________________________________
>>> >> >> Gambas-user mailing list
>>> >> >> [hidden email]
>>> >> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>> >> >>
>>> >> > ------------------------------------------------------------
>>> >> ------------------
>>> >> > Check out the vibrant tech community on one of the world's most
>>> >> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> >> > _______________________________________________
>>> >> > Gambas-user mailing list
>>> >> > [hidden email]
>>> >> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Fabien Bodard
>>> >>
>>> >> ------------------------------------------------------------
>>> >> ------------------
>>> >> Check out the vibrant tech community on one of the world's most
>>> >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> >> _______________________________________________
>>> >> Gambas-user mailing list
>>> >> [hidden email]
>>> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>> >>
>>> >-----------------------------------------------------------
>>> -------------------
>>> >Check out the vibrant tech community on one of the world's most
>>> >engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> >_______________________________________________
>>> >Gambas-user mailing list
>>> >[hidden email]
>>> >https://lists.sourceforge.net/lists/listinfo/gambas-user
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Gambas-user mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>>
>>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...