Re: Executing queries with parameters

"Klaus Schneider-Grosch (gmx.de)" <[email protected]> Wed, 14 Jan 2009 16:20:43 +0100
Newsgroups gmane.comp.db.rekall.general
Message-ID <[email protected]>
Hello Andree,

this seems to be the code inside the query.
> WHERE RechnungErfolgteZahllungAm > 2007 AND RechnungErfolgteZahllungAm <
> 2009

I do not like to touch the query itself (there is no question about the WHE=
RE=20
clause), but I prefer to call the query from a script with a parameter, lik=
e=20
I do it with forms and reports. Here a well working example with a report:

button.getBlock().getForm().openReport("Report_rr", \
	{\
        'KName' : intName , \
        'RNummer' : intRN, \
	'Anf' : cAnf.strip() \
        })       =20

The question is: How can I transmit a parameter (here: an additional WHERE=
=20
clause) to the query in a similar way. The code below is described in the=20
rekall manual, but it does not work. Maybe I have a wrong idea or my code i=
s=20
bad:

def eventFunc (button) :
	button.getBlock().getForm().openQuery('SummeKunde', \
	{\
	'RechnungErfolgteZahllungAm' : '2008%' \
	})

Thank you for your patience,
Klaus

Am Dienstag, 13. Januar 2009 21:42:46 schrieb Andree Clausing:
> Sorry , false answer..
>
> WHERE RechnungErfolgteZahllungAm > 2007 AND RechnungErfolgteZahllungAm <
> 2009

>
> Andree
>
> Am 13.01.2009, 21:24 Uhr, schrieb Klaus Schneider-Grosch (gmx.de)
>
> <[email protected]>:
> > Hello Andree,
> >
> > RechnungErfolgteZahllungAm is a date
> >
> > Gru=DF aus Heidelberg
> > Klaus
> >
> > Am Dienstag, 13. Januar 2009 21:03:21 schrieb Andree Clausing:
> >> Hello Klaus..
> >>
> >> is RechnungErfolgteZahllungAm a string or a timetamp?
> >>
> >> Gru=DF aus Halle / Westf.
> >>
> >> Andree
> >>
> >> Am 13.01.2009, 20:56 Uhr, schrieb Klaus Schneider-Grosch (gmx.de)
> >>
> >> <[email protected]>:
> >> > Am Montag, 12. Januar 2009 17:30:19 schrieb Andree Clausing:
> >> >> Shure, execute query's from Python works as expected, there is a
> >>
> >> howto
> >>
> >> >> in
> >> >> the
> >> >> Rekall manual.
> >> >>
> >> >> You can build your own query as string and execute it.
> >> >>
> >> >> Andree
> >> >>
> >> >>
> >> >> Am 12.01.2009, 16:36 Uhr, schrieb Klaus Schneider-Grosch (gmx.de)
> >> >>
> >> >> <[email protected]>:
> >> >> > Hello,
> >> >> >
> >> >> > is it possible to execute a query with parameters from a python
> >> >>
> >> >> script,
> >> >>
> >> >> > and if
> >> >> > yes, how to do it?
> >> >> >
> >> >> > Alternatively, is it possible to roll my own query in the way that
> >>
> >> is
> >>
> >> >> > described in the rekall manual for forms ("Roll Your Own Form")
> >>
> >> with
> >>
> >> >> > xml-Code?
> >> >> >
> >> >> > Thank a lot,
> >> >> > Klaus
> >> >
> >> > This is the code:
> >> >
> >> > def eventFunc (button) :
> >> > 	button.getBlock().getForm().openQuery('SummeKunde',
> >> > {  'RechnungErfolgteZahllungAm' : '2008%' })
> >> >
> >> > The query 'SummeKunde' delivers every year, but I want to get only t=
he
> >> > results
> >> > of the year 2008. So I add the parameters of fieldname and the WHERE
> >> > clause '2008%'
> >> >
> >> > What am I doing wrong?
> >> >
> >> > Thank you, Klaus