Skip to Content
Former Member
Apr 12, 2013 at 06:26 AM

executing procedure from powerscript in a loop does not work properly


Dear all,

I have one stored procedure in Sybase and i am running that stored procedure in powerscript in a loop for different parameter. It randomly generates the output of that procedure.

Stored procedure calculates some data and calculated value is stored in the database and it is then viewed by the user. It is run for different period say 3,6,9 and 12 month as one of its parameter. i have following script written

For li_start = 1 to li_cnt

ls_sql = "EXEC calc " + string(ll_period)

li_ret = SQLCA.of_execute( ls_sql)

If li_ret <> 0 Then

-- error message in log file


-- success message in log file

end if

When user checks for the calculated data, it is missing randomly. sometime 3 month data is missing and rest is available and sometime, 6 month data is missing and rest are available or sometime 3 and 6 is missing and rest is available. There is no such fix pattern.

if i run the script from back end one by one as

exec calc 3


exec calc 6


exec calc 9


exec calc 12


it calculates the data for all periods without any issue.

any idea why it is happening as it seems that powerbuilder has some issues related with some transaction or donno something else