Greetings All,
I have a function that does something simple:
Argument: sp_id (string)
Return: Integer
integer staged_rates
sp_id = trim(sp_id)
select count(*) into :staged_rates where sp_id = :sp_id;
commit;
return staged_rates
When I run the SQL in the database painter, I get 115,820 rows.
When I run the SQL in a datawindow, I get 115,820 rows.
But when I call the function from a datawindow either in a computed field as uf_get_rowcount_by_sp_id(sp_id) or in the retrieve_end script to set the values in a datawindow, I get mixed results.
If there are less than 20,000 rows, I generally get the correct count. But I have some instances where there are 50,000 to 115,000 rows and I see '0' rows.
I tried changing the datatype of staged_rates from integer to long and now I see rows where before it was 0, but oddly, they are negative (e.g. -15252 rows).
If someone can point me in the right direction, I would certainly appreciate it.
Thanks all!!
Paul