on 2020 Feb 13 12:07 PM
I have created a functionA in SQL Anywhere 17, and then set it to hidden.
I want to restrict the use of this function to a list of procedures (i.e. only ProcedureA & ProcedureB may make use of the functionA).
Is there a way to ask within functionA from which procedure am I called?
In the documentation I found only the SQL SECURITY clause which is not exactly what I want!
Request clarification before answering.
Starting with v17, there are four new special values that will be of help:
Use INVOKING USER, SESSION USER, EXECUTING USER, and PROCEDURE OWNER to determine which users can execute, and are executing, procedures and user-defined functions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oops, sorry, apparently I misread your question...
You can probably include calls to the stack_trace() system function or the similar sa_strack_trace() system procedure to find out about invokers.
Say, something like:
message 'Function stack: ' || stack_trace('caller', 'stack+sql') to log;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
52 | |
6 | |
5 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.