ncgjiju
12th August 2008, 11:38
I have a problem ,i am unable to exit from sql select statement for example
long count
select b.*
from b
selectdo
count = count + 1
if count >= 10 then
exit select
endif
end select
i want to exit from the select after 10 recs for example.
Kozure Ohashi
12th August 2008, 11:49
You can use:
select
selectdo
if condition
break
endif
endselect
Regards,
Kozure
ncgjiju
12th August 2008, 12:05
Kozuresan,
Thanks for your help.
regards,
George:)
NPRao
12th August 2008, 20:47
Alternatively, you can use - SET specification (http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_set_specification)
For example -
select ttaad200.* from ttaad200 where ttaad200._compnr = 000 order by ttaad200._index1 as set with 10 rows
tarp0cor
30th September 2008, 00:12
You can use:
select
selectdo
if condition
break
endif
endselect
Regards,
Kozure
Is there a way to only SKIP a record (LOOP to the next record) instead of breaking out of the whole select? I have many "IF.. THEN" and / or SELECT that I couldn't put in my main SELECT conditions and the only way around it would be to setup flags here and there or have multi nested levels of "IF..THEN..ELSE..." instead of just skipping that record...
Thanks!
Kozure Ohashi
30th September 2008, 00:23
Please try
"continue"
instead of "break".
Regards,
Kozure