Hi Rob,

> I can do this:
>
> filtervalue=hk_thisform.get_pyvisible("pcb_number").listcolumn().asstring()
> sqlstring = "SELECT kcode AS reference_designator, COUNT(kcode) AS
> QUANTITY FROM pcb_boms WHERE pcb_number= " + filtervalue + "GROUP BY
> kcode;" db=hk_thisform.database()
> query=db.new_actionquery()
----------------------------------
> query.set_sql(sqlstring)
> status=query.execute()

As far as I can see, you want to do a SELECT-query but you are using the 
syntax of an 'actionquery' in order to execute it. The latter type of query 
doesn't give back the value of your query. Have a look at the knoda scripting 
tutorial, chapter 5 ' tips and tricks - how to execute a query'. 
As I wrote in a former mail I don't know very much about mysql but I suppose 
it can do pretty the same things as postgresql. Therefore my question/advice: 
Why don't you write functions in mysql for your mostly used querys. The 
server-side execution of queries normally is far quicker then doing this in 
your frontend. The second and perhaps the more important advantage is, that 
you can do most of your queries with one generic knoda - Select query - 
script (you only have to ensure that all your mysql-functions give back a 
value). 
Best regards,
Michael 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Hk-classes-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hk-classes-discuss

Reply via email to