baan_ghai
6th May 2005, 07:23
between Selectdo and endselect
any other option like selectempty

select
from
where
selectdo
''''''Any other option like selectempty

selectempty

endselect


please help


thanks
sanjeev

NPRao
6th May 2005, 08:16
Sanjeev,

Refer to the link - Embedded SQL (http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_embedded_sql)

The following loop structure enables the use of SQL as part of the language:

SELECT < set definition (= actual query, see syntax description) >
[ SELECTBIND ( number, var) ] ...
[ WHEREBIND (number, expression) ] ...
[ SELECTDO
< operation(s) on all selected records > ]
[ SELECTEOS
< operation(s) after last selected record > ]
[ SELECTEMPTY
< operation(s) if nothing has been selected > ]
[ SELECTERROR
< operation(s) in case of an error condition > ]
ENDSELECT

lbencic
6th May 2005, 17:03
I herby resubmit my request that they put in a 'selectfirst' :)

en@frrom
30th June 2006, 14:51
However, the 'selectfirst' is easily workable by using a simple flag. You declare for instance
domain tcbool first
first = true

select...
from...
selectdo
if first then
first = false
actions to be performed...
endif

metbaan
30th June 2006, 17:13
I second the request for a "Selectfirst". Agreed the workaround is simple (and I have used it a million times), but if they have a "selecteos", they should have a "selectfirst" as well.

:D

en@frrom
30th June 2006, 17:16
Yes and no. Yes because it is convenient, no because it is much easier to track the first record than the last. Tracking the last record, is in many cases impossible without an additional select..