SQL queries and their results



First of all, let me start by saying that I love Glom. I've tried a lot
of other database softwares, but haven't found anything approaching the
ease of use and versatility that Glom offers.

Unfortunately, its documentation is rather sparse. I'm familiar with SQL
databases, and with the python language and syntax; but I'm accustomed
to accessing SQL through PHP scripts.

In PHP, if I wanted to perform and advanced database query, I would
write something like:
$query="SELECT * FROM tblCustomers WHERE fldId = $thisId AND
fldFrequentCustomer = TRUE";
$result=mysql_query($query);
while ($row=mysql_fetch_assoc($result)) {
        echo $row["fldFirstName"]." ".$row["fldLastName"]."<br>";
}

It's useful to me because I can directly access the database without
having to set up a relationship between tables in a GUI, and because I
can specify the individual fields by name (fldFirstName, fldId, etc).
The closest thing I've found to documentation on the subject is at the
website:
http://library.gnome.org/users/glom/unstable/sec-calculated-fields.html.en
The bottom of the page shows an example utilizing an SQL query, but I'm
not familiar with the functions used to access the information. The only
function I see that accomplishes direct data access is
"data_model.get_value_at(col_index, row_index).get()." The problem is,
the data must be specified by row index (not too big a problem, but also
by a numerical column index (rather than the field name). This seems a
bit convoluted to me, and I expect that there's a simpler way to
accomplish it, but I haven't been able to find it in online
documentation or even an Ubuntu forum post.

Please help, and thank you for your time.
--D. Scott Nettleton






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