Hi! so basically my problem is that I made a new stored procedure without passing any variable and tested it by directly executing it from sql. It runs perfectly, so the next thing I tried is running it on xbasic from alpha, but when I checked the database, it seems only part of the data was processed while when I debugged the code from alpha the callresult.text says "success".
My SP is used to process data from table A and insert it from table B, first I created a new table Temp and inserted data from table A to Temp, do a while loop based on this Temp table and inside the loop I collected the data necessary from another table, stored it in a variable and inserted it to table B and lastly update a column in both table A and Temp called "ProcessedStatus" from 0 to 1.
What I noticed was, first, when I executed the SP from sql, all 1068 rows of data got the column ProcessedStatus updated from 0 to 1. But when I executed it from xbasic, only around 80-300 rows for affected. I didn't pass any parameter to this SP since all the data I need is from another table so I don't think the problem lies on the data processed and no error showed up when I executed it from sql directly.
Secondly, I have another SP that has the same function to the one I said before, process data from a table and inserted it to another. But the message shown in sql is different. Where my SP in question shows
and so on until the loop ends (1068 times), where the other shows
is this have anything to do with why my SP didn't run all the way?
Thirdly, my xbasic code runs 3 SP in the same script, where 2 of them, let's call them SP_A and SP_B are the one that returns "Command(s) completed successfully." and there's a few seconds time lag when I'm at the line where the SP got executed, and the third one, SP_C is the SP that didn't run all the way, when I wen't over the line that executed the SP, I got a little to no time lag. So I didn't think this problem was because a timed out from alpha.
And lastly I encounter the same problem when I was developing SP_A and SP_B where they won't complete all the way from alpha, and I asked about it too in this forum. A few people says it's because I used cursor to loop which didn't have a good performance, and they advised me to use temporary table. And so I did and my problem was solved. But now I'm encountering the same problem while I'm using temporary table.
And I got stuck around this problem for the past few days, is there any way to solve this? And what is the reasons behind this problem?
My SP is used to process data from table A and insert it from table B, first I created a new table Temp and inserted data from table A to Temp, do a while loop based on this Temp table and inside the loop I collected the data necessary from another table, stored it in a variable and inserted it to table B and lastly update a column in both table A and Temp called "ProcessedStatus" from 0 to 1.
What I noticed was, first, when I executed the SP from sql, all 1068 rows of data got the column ProcessedStatus updated from 0 to 1. But when I executed it from xbasic, only around 80-300 rows for affected. I didn't pass any parameter to this SP since all the data I need is from another table so I don't think the problem lies on the data processed and no error showed up when I executed it from sql directly.
Secondly, I have another SP that has the same function to the one I said before, process data from a table and inserted it to another. But the message shown in sql is different. Where my SP in question shows
Code:
(1068 row(s) affected) (1 row(s) affected) (1 row(s) affected) (1 row(s) affected) (1 row(s) affected)
Code:
Command(s) completed successfully.
Thirdly, my xbasic code runs 3 SP in the same script, where 2 of them, let's call them SP_A and SP_B are the one that returns "Command(s) completed successfully." and there's a few seconds time lag when I'm at the line where the SP got executed, and the third one, SP_C is the SP that didn't run all the way, when I wen't over the line that executed the SP, I got a little to no time lag. So I didn't think this problem was because a timed out from alpha.
And lastly I encounter the same problem when I was developing SP_A and SP_B where they won't complete all the way from alpha, and I asked about it too in this forum. A few people says it's because I used cursor to loop which didn't have a good performance, and they advised me to use temporary table. And so I did and my problem was solved. But now I'm encountering the same problem while I'm using temporary table.
And I got stuck around this problem for the past few days, is there any way to solve this? And what is the reasons behind this problem?
Comment