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! |
Starting with v17, there are four new special values that will be of help:
Thanks for the answer, but these four special values help me to determine the user, and not the name of the calling procedure. But yes, I can I can create my UserA, and then create my ProcedureA & ProcedureB in the name of this UserA, so that it can work as I want. Thank you
(13 Feb '20, 12:55)
Baron
|
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; I have tried STACK_TRACE and it worked and did exactly what I want! Thank you!
(19 Mar '20, 12:50)
Baron
|