How can I obtain the object_id value for executing SQL Anywhere code. If accessible, I could then obtain the name of the executing SQL Anywhere code with:
declare my_object_id integer;
declare executing_object_name char (128);
set my_object_id = ???;
set executing_object_name = object_name (my_object_id);
If I knew what to substitute into '???', I could obtain the name of any stored procedure or trigger that is currently executing.
Is there another way to do this?
Thanks, Dan.
Request clarification before answering.
There is a global variable available called @@procid (as part of the TSQL support) that may help.
Doing something along the lines of
select proc_name from sys.sysprocedure where proc_id=@@procid;
seems to fix your purpose.
This was added back in version 5 and is still documented for V16 and still seems to work in V17. Future versions may or may not continue this tradition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.