I am trying to create a stored procedure that will select all the records in a table and trim the spaces from the beginning and end of the data. The data was imported from REVG and somehow picked up spaces at the beginning and end of multivalued fields. The procedure I wrote does not seem to run at all since there is no disk read when you execute the executable. I sure would appreciate any help anyone could give.
Compile Subroutine REV_IMPORT_UPDATE(CharStr Done)
Begin Condition
Pre:
Post:
End Condition
$Insert Logical
Done=FALSE$
Open "VCR" To FRIU Then
Select FRIULoopReadnext Key ThenRead Tape From FRIU,Key ThenStart=TapeFinish=TapeName=TapeType=TapeLength=TapeSpeed=TapeSt=Count(Start,@VM)+1For X=1 to StStart=TrimB(Start)Start=TrimF(Start)Next XFn=Count(Finish,@VM)+1For X=1 to FnFinish=TrimB(Finish)Finish=TrimF(Finish)Next XNm=Count(Name,@VM)+1For X=1 to NmName=TrimB(Name)Name=TrimF(Name)Next XTy=Count(Type,@VM)+1For X=1 to TyType=TrimB(Type)Type=TrimF(Type)Next XLn=Count(Length,@VM)+1For X=1 to LnLength=TrimB(Length)Length=TrimF(Length)Next XSp=Count(Speed,@VM)+1For X=1 to SpSpeed=TrimB(Speed)Speed=TrimF(Speed)Next XTape=StartTape=FinishTape=NameTape=TypeTape=LengthTape=SpeedWrite Tape To FRIU,Key Else NullEndEnd Else Done=TRUE$Until Done RepeatEnd
Richard,
I'd like to help, but you have to make me understand what you mean by:
"The procedure I wrote does not seem to run at all since there is no disk read when you execute the executable" .
Can you not attach the table?
If you can attach the table, can you not read records from the table?
If you can read, can you not write back to the table?
Etc.
Thanks
Dave
Using the System Editor, I can attach the table and read the records. When I run the Stored Procedure, nothing happens. If I insert a debug command in the procedure, it does not bring up the debugger.
Richard,
Cannot see anything wrong with the programming except I wonder why you have Done as a subroutine parameter. Surely Done must be a local variable.
- Oystein -
There was an intermittent problem in 3.61 that the debugger would not be invoked until you had manualy invoked it. Could this be the problem here?
World Leaders in all things RevSoft
I'm using OIS 3.7.
It wouldn't compile without an argument so I invented one.
Some silly ideas:
Always use CLEARSELECT before doing a SELECT. If you terminated a READNEXT before reading all the keys on a prior run, you may get unpredictable results on a subsequent SELECT.
I remember in the early days of OI trying to use a table which started with the letters 'SYS'. No matter what I tried, I could not get data in or out of the table. The table builder happily created the table for me - but that was the end of it. It eventually hit me that the prefix 'SYS' was reserved for SYStem tables. The point I'm trying to make is that a SP prefixed with 'REV' may suffer from the same problem. Try renaming your proc to something else.
Good luck.
Richard,
Let me get this straight:
If you put a debug statement in at the beginning, the debugger never kicks in, right?
Is it just this subroutine, or any subroutine in your system?
It seems to be all stored procedures.
Richard,
It sounds like you need to enable the debugger. Open it by using the Tools-Advanced menu in OpenInsight. Choose enable from the Debugger's File menu.
Cameron Purdy
Revelation Software
I know I'm not the shiniest penny in the pile but I don't see the enable choice in the debugger's file menu.
Richard,
If the debugger were disabled, it would look like:
Cameron Purdy
Revelation Software
The File menu has four open commands and exit.
Richard,
That sounds like it is not disabled. If you type "run debug" and press enter from the System Editor command line, what happens?
Cameron Purdy
Revelation Software
The debugger opens normally.
Richard,
The DEBUG SPP has one line of code which says "debug". Since you ran it and it opened the debugger, your original assumption is incorrect (that no stored procedures with a debug statement invoke the debugger).
I cannot determine from your posts any information that would help me track the problem down. For the stored procedure which does not go to the debugger, what is the name of the stored procedure? If you put a debug statement after the subroutine/function declaration and compile/run it, what happens? Have you tried to delete the $ record in SYSOBJ for that procedure and then re-compiled it to verify that it is being compiled?
Cameron Purdy
Revelation Software
When I run the SPP from the application manager/openinsight executables/stored procedure executables nothing seems to be happening. In order to check if it was running at all, I added a debug statement to the SPP and again nothing happened. I deleted the $ record in SYSOBJ and recompiled and got the same results.
FYI, I am using OIS 3.7 with Win98 as a single user. I have also tried it at my office using OIS 3.7 with WinNT4/SP3.
I'm really stumped. I really appreciate your help.
and if you go to the system monitor and type RUN MYPROG what happens?
World Leaders in all things RevSoft
I get the following error message:
ENG0010: $!, line 1. Variable has not been assigned a value.
Hmmm….If it's ! breaking, this means there something wrong with an index somewhere. How does this affect itself on a stored procedure with a simple debug? Did you place an index on SYSPROCS or something?