Hi Norbert,
The scenario is that the user is presented with a grid of the entity, they fill in a retrieve profile against one, many or none of the fields and this is passed (via XML) to a service, which then retrieves the records and passes them back (via XML) to the form.
As such I don't know which fields, if any, will have valid retrieve data in them (which may or may not have profile characters).
One of the fields is a datetime.
I was therefore having great difficulty working out how to parse the current 'retrieve profile', which will be used by the subsequent retrieve to actually fetch the data, into a u_condition to be passed to the selectdb to determine the total hits (for pagination), and the selectdb doesn't use the current field profiles to filter the count(field).
if the field DT_CR contains '.>.=20230506000000' (greater than or equals 06/05/2023) how to parse that to work with selectdb, which needs it's operands in plain text, and it's dates in a completely different format.
lookup does use the current "retrieve profile" and therefore filters the hits using whichever fields are populated. The examples in the documentation however, use selectdb to calculate the same number, but there's no practical example of how to filter this based on user input containing wildcards in only some of the fields.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
Original Message:
Sent: 01-19-2024 10:07
From: Norbert Lauterbach
Subject: selectdb and the retrieve profile
Hi Iain,
for me it looks like selectdb can work with profiles as statet in the Doku.
<pre>
trigger detail
variables
numeric V_SUM
endvariables
selectdb count(rnr) from "ESB" u_where (esb = 'I100*22') to V_SUM
message "%%$datim Sum: (%%V_SUM)"
end
</pre>
Instead of count(*) you can use any fieldname. rnr is a field in table ESB.
The * in I10022 is a Gold
Regards
Norbert
------------------------------
Norbert Lauterbach
Infraserv Gmbh & Co. Höchst Kg
Frankfurt DE
Original Message:
Sent: 01-18-2024 12:55
From: Iain Sharp
Subject: selectdb and the retrieve profile
Is there a simple way of having selectdb pay attention to the retrieve profile? I have a pagination issue where the selectdb to get the total number of hits needs to use the retrieve profile, but the fields are of different types and I don't know how to build the u_condition.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------