Re: Executing queries with parameters
"Andree Clausing" <[email protected]> Wed, 14 Jan 2009 17:52:30 +0100
| Newsgroups | gmane.comp.db.rekall.general |
|---|---|
| Message-ID | <op.unrahscbomelh4@andree-eee> |
Its a little hide, but it's easy..
REPORT:
- Right click on the outer block from the report.
- klick on the "query" button (is it grayed you have the false block)
here you can change the Where condition.
(EntryDate >= ${from_date}) and (EntryDate < ${to_date})
FORM:
def eventFunc (button) :
button.getBlock().getForm().openReport \
( "Clients",
{ from_date : "01.01.2008" }
{ to_date : "31.12.2008" }
)
OR
def eventFunc (button) :
button.getBlock().getForm().openReport \
( "Clients",
{ from_date : "01.01.2008", to_date : "31.12.2008" }
)
I'm unshure, my last Project with Rekall was 2007 - test it with one
parameter
when its working, try it with more.
You can find a example database here:
http://www.rekallrevealed.org/packages/
Hope this will help you.
Andree
button.getBlock().getForm().openReport("Report_rr", \
{\
'KName' : intName , \
'RNummer' : intRN, \
'Anf' : cAnf.strip() \
})
Am 14.01.2009, 16:20 Uhr, schrieb Klaus Schneider-Grosch (gmx.de)
<[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
> WHERE
> clause), but I prefer to call the query from a script with a parameter,
> like
> 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() \
> })
>
> The question is: How can I transmit a parameter (here: an additional
> WHERE
> clause) to the query in a similar way. The code below is described in the
> rekall manual, but it does not work. Maybe I have a wrong idea or my
> code is
> 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ß aus Heidelberg
>> > Klaus
>> >
>> > Am Dienstag, 13. Januar 2009 21:03:21 schrieb Andree Clausing:
>> >> Hello Klaus..
>> >>
>> >> is RechnungErfolgteZahllungAm a string or a timetamp?
>> >>
>> >> Gruß 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
>> the
>> >> > 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
> _______________________________________________
> Rekall mailing list
> [email protected]
> http://www.mailman.a-i-s.co.uk/cgi-bin/mailman/listinfo/rekall