Cameron, need more help with the TRANSACT statement (OpenInsight Specific)
At 05 DEC 1997 07:39:38PM Dave Pociu wrote:
I still cannot figure ou twhat parameters to pass to this function. It keeps bombing out no matter what I pass to it.
Here' s my test code:
COMPILE SUBROUTINE TEMP(VOID)
declare function transact
call control_on("SOD" , 1) /* turn control on temporarily for the table */
SQLState='
result=transact( 2 , SQLState) /* Line 6 -]Begin transaction */
result=transact( 1 , SQLState) /* Commit */
call control_off("SOD" , 1) /* Control is turned off */
This is the error message I get :
ENG0010: TEMP, line 6. Variable has not been assigned a value.
I cannot figure out from the inserts what SQLState should be when passed in. Is that the problem?
At 06 DEC 1997 06:12PM Cameron Revelation wrote:
Dave,
Please step through your code in the debugger and tell me which function is failing with that error.
Thanks,
Cameron Purdy
Revelation Software
At 06 DEC 1997 08:49PM Dave Pociu wrote:
Cameron,
The function that is failing with that error message is the TRANSACT function.
Here's the code I just used for testing:
compile subroutine temp(void)
declare function transact
Stat=2
SQLState="
result=Transact( Stat , SQLState)
return
The "ENG0010: temp line 5. Variable has not been assigned a value" error message comes up as soon as I execute the "result=Transact(Stat , SQLState)" line.
The curious thing is that the first time I execute the procedure (from the EXEC line as "run temp") , both result and SQLState are set to 0 when the error message comes up.
From the second time on, the result variable is still set to 0 but SQLState is set to 1003.
Now aside from that, as soon as I acknowledge the ENG0010 error message, I cannot continue stepping through the rest of the code, but rather have to close the debugger. (This is probably normal, but I figured I'd mention it anyway.)
Now would you be so kind and tell me :
1. is this piece of code doing the same thing on your system?
2. what is it that I'm doing wrong?
I'm seriously considering writing my own TRANSACT function that will write records to a temp file and commit them from there or delete them on Rollback. It would not be as elegant as using the existing Transact function though, so that' s why I want to make this work.
Please let me know ASAP what you think is happening here because I need to deliver the code that includes this by Thursday.
Thanks
P.S. I ran this on OI 3.5 pre-release 3 on both Win95 and Win NT 4.0 workstation. Both on standalone and network. With the same results.