Re: database connection syntax



On Sat, 2006-03-04 at 15:07 -0500, Renan J. Felix wrote:
I'm trying to connect to an SQLite database but I'm having trouble with
the syntax. Typing the following command ina cell:
=execSQL("SalesTest","","","select * from locations") returns only "FR"
in the cell. I know this table has two records with 3 fields in each
record. I was expecting "FR, Tolouse, Tolouse,France" and another row
with more data. Is there something wrong with my syntax in the execSQL
statement? There is no documentation on this Gnumeric/gda feature. I
will write a user guide once I figure this out so any help is
appreciated. Thanks! 


You probably need to use the syntax for a matrix returning function.

Select the rows and columns you want to be populated with the result,
and enter the forumula, whne done entering the forumal, Ctrl-Shift-Enter
rather than Enter.

Alternately, use syntax like this:

Cell A1 - {=execSQL("SalesTest","","select * from
locations")}(3,2)[0][0]
Cell B1 - {=execSQL("SalesTest","","select * from
locations")}(3,2)[0][1]
Cell A2 - {=execSQL("SalesTest","","select * from
locations")}(3,2)[1][0]
Cell B2 - {=execSQL("SalesTest","","select * from
locations")}(3,2)[1][1]
Cell A3 - {=execSQL("SalesTest","","select * from
locations")}(3,2)[2][0]
Cell B3 - {=execSQL("SalesTest","","select * from
locations")}(3,2)[2][1]

I haven't used the SQL connectivity, so I could be mistaken, but this is
how the matrix functions like transpose work.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]