Salut,
Peut-on affecter dynamiquement (à partir du context) la valeur MaxRows d'un DBExtract ?
:MaxRows ? {$MaxRows} ne semble pas marcher ?
nicolas
Salut,
Peut-on affecter dynamiquement (à partir du context) la valeur MaxRows d'un DBExtract ?
:MaxRows ? {$MaxRows} ne semble pas marcher ?
nicolas
Bonjour,
En tout cas jusqu'en version 2005, le maxrow ne supporte pas les templates. Tu peux donc le faire par code, dont voici un exemple en delphi:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 procedure TMonXMLModule.MonXMLServiceBeforeInstruction( XMLInstruction: IXMLInstruction; e: TBeforeInstructionEventArgs); var MonInstruction:TDBExtract; begin if XMLInstruction.Name = 'MonInstruction' then begin MonInstruction := TDBExtract(XMLInstruction.ObjectReference); MonInstruction.MaxRows := strtointdef(Context.GetValue('MAXROWS'),25); end; end;
cooooool exactement ce que je cherchais. Je testerai ça dès demain matin (sous delphi ca tombe bien !).
merci bien
nico
euh http://xmlrad.com/DelosBin/Delos.dll...1015#DBExtract
certes c'est pas les templates, mais ca revient au même (c'était bien avant l'introduction des templates properties)MaxRows
Number of records to be fetched from the query.
Applies only when ExtractKind=Multiple.
If the query is at the end of the cursor before MaxRows, then it exits.
If MaxRows=-1 then all records will be extracted. You should be very careful when using this value, it may result in freezing your server due to expanding memory to build the whole XML document containing zillions of records.
You may change the MaxRows property value by assigning the Context with the DBExtract name concatenated with '_MaxRows'. (Note: Restricted to max 1000 records).
Merci à vous 2,
Finalement j'ai opté pour la solution du ..._MaxRows dans le Context qui marche parfaitement :-)
A bientot
nicolas
Juste une petite précision,
Pour éviter de le faire par code, il suffit d'ajouter une XMLInstruction Assign avant l'instruction DBExtract.
Dans cette instruction Assign, on peut indiquer par exemple :
- Destination : Context
- Destination Field : NomXMLInstruction_MaxRows
- Value : 20 par exemple
Et voilà encore du code en moins![]()
Partager