[Gambas-user] result from select can be movefirts from ODBC?
PICCORO McKAY Lenz
mckaygerhard at ...626...
Mon May 22 15:21:44 CEST 2017
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 <mckaygerhard at ...626...>:
> 2017-05-21 12:33 GMT-04:30 <d4t4full at ...626...>:
>
>> 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 <
>> mckaygerhard at ...626...> 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 <gambas.fr at ...626...>:
>> >
>> >> 2017-05-18 17:13 GMT+02:00 PICCORO McKAY Lenz
>> ><mckaygerhard at ...626...>:
>> >> > 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 :
>> >>
>> >> gambas.fr at ...626...
>> >> >
>> >> > Lenz McKAY Gerardo (PICCORO)
>> >> > http://qgqlochekone.blogspot.com
>> >> >
>> >> > 2017-05-17 18:49 GMT-04:00 Tobias Boege <taboege at ...626...>:
>> >> >
>> >> >> 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
>> >> >> 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
>> >>
>> >>
>> >>
>> >> --
>> >> 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
>> >> 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
>> ------------------------------------------------------------
>> ------------------
>> 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