[Gambas-user] SQLite PRAGMA don't seem works any more

Jorge Carrión shordi at ...626...
Tue Jan 6 17:29:11 CET 2015


I find the old code that shows the slowly of database objects in loops.
Just trying to get de length of all fields of all tables in a database:

 For Each tbl In hc.Tables
        Print tbl.Name
        For Each fld In tbl.fields
            awidths.Add(fld.Length)
        Next
  Next

I try it with two databases:

 A SQLite database with 16 tables and 127 fields.
 A MySQL database with  6 tabñes amd 82 fields.

The result is attahed in two images.

With SQLite is not a bad result, but in MySQL is a disaster...
It seems like gambas has to "travel thru the web" in order to get the
information of each field of each table...
I use, then, the "show columns for tablename" instruction in MySQL... and
the PRAGMA fields_info in SQLite that does the work at once... but PRAGMA
doesn't work any more.
Looking this test is not a big issue: I can use different way to each
database type, but PRAGMA is a must-work on SQLite, I think.

Regards


2015-01-06 16:27 GMT+01:00 Jorge Carrión <shordi at ...626...>:

> >I'm curious about how you wrote your loop...
>
> I'll try to find the old code where I did those loops. I think I should
> have a sample in some old backup.
>
> >No idea. When you use "Exec", the request is directly sent to the
> >database client library. What does not work?
>
> That instruction exctact from database a info fields result, similar to
> Mysql's "show columns from tablename" sentence.
>
> The result has a line for each Field with information, but now the result
> is not available and the fields.count is 0.
>
> Other software like sqliteman application show the result without
> problems... like Gambas used to did.
>
> Attach image of sqliteman screen
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mysql.png
Type: image/png
Size: 107793 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150106/fe440554/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqlite.png
Type: image/png
Size: 104950 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150106/fe440554/attachment-0001.png>


More information about the User mailing list