on 2010 Nov 19 11:22 AM
...and the answer is, from Bruce's comment on his original answer: "@Breck: there is currently no mechanism for automatically recompiling events. You can, of course, put the logic for the event in a procedure which the event calls. – Bruce Hay"
Here's the scenario in 11.0.1.2276: An updated stored procedure event failed at runtime with "column not found" because of a FOR loop which referred to the new name of a column in an existing table when, in fact, the table still had the old column name. An ALTER TABLE was run to fix the column name, and the stored procedure event was re-executed, only to fail with "Invalid statement" (see below). The stored procedure event was recompiled and that got rid of the "Invalid statement" error.
If this is expected behavior, the Help should be updated to mention the possibility that a stored procedure an event should be recompiled:
http://dcx.sybase.com/index.html#1101en/saerrors_en11/errm130.html
Invalid statement Error constant SQLE_INVALID_STATEMENT ODBC 2 State ERROR ODBC 3 State ERROR Severity 16 SQLCODE –130 SQLSTATE 07W02 Sybase error code 13628 Probable cause The statement identifier generated by a PREPARE passed to the database for a further operation is invalid.
Request clarification before answering.
The most likely cause for the problem described here is that the procedure was still being used by at least one connection when the ALTER TABLE was performed. For example, if the procedure returns a result set and the application cursor had not been closed, then the procedure would still be in use. Once all references to the procedure have completed, the next call will cause the procedure to be "recompiled" automatically.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Volker: procedures not currently in use are recompiled immediately when an ALTER TABLE occurs. Those that are in use will be recompiled when they are no longer in use by any connection, and a new call is made.
@Breck: there is currently no mechanism for automatically recompiling events. You can, of course, put the logic for the event in a procedure which the event calls.
User | Count |
---|---|
33 | |
22 | |
17 | |
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.