Learning the ropes with Knoda and hk_classes, 
I am developing privately a front end application
to manage my music collection, before trying the
more important stuff. I have done this previously 
with another set of software.

Important for me is data manipulation in the background
under program control. Here is the sample I am trying
out presently:

KomponistenID=hk_thisform.datasource().column_by_name("KomponistenID")
dr=hk_drivermanager()
con=dr.new_connection("mysql")

con.connect()
db=con.new_database("musik")
query=db.new_resultquery()

query.set_sql("SELECT concat(Komponisten.FirstName , " ", Komponisten.FamName) \
    FROM Komponisten WHERE ((Komponisten.KomponistenID = 16))")

query.enable()
query.goto_first() # could not get any further after this.

The result from this query would be the string "Eric Satie".

Here some questions for which I did not find any answer in the documentation:

1. How to continue the above code snipped in order to get this resulting 
string into a variable, which I can further use or manipulate? 
I have not found anything in the documentation on how to do this. 

2. To use a constant "16" in the WHERE clause is rather abnormal, 
this should instead be a variable "KomponistenID" (see the first line of 
sample).
How is this to be handled in Knoda? Do the variables have to be worked into the 
query string, or is there a way of using placeholders (for instance a "?") 
plus a list of variables to replace the query variables at runtime? Both is 
possible, but the second method would be preferable from my point of view. 
Less tedious and error prone, specially in complicated queries.

Thanks for an answer to these questions. 

Egbert
       
---------------------------------
One email account is enough. Simplify your life by switching other accounts 
into Yahoo! Mail.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Hk-classes-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hk-classes-discuss

Reply via email to