[Gambas-user] result from select can be movefirts from ODBC?
Cristiano Guadagnino
criguada at ...626...
Thu May 18 00:31:28 CEST 2017
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 <mckaygerhard at ...626...>
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 <taboege at ...626...>:
>
> > 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
> > Gambas-user at lists.sourceforge.net
> > 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
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list