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!

asked 13 Feb, 12:07

Sako's gravatar image

Sako
656334671
accept rate: 27%

edited 13 Feb, 12:09


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.

permanent link

answered 13 Feb, 12:41

Volker%20Barth's gravatar image

Volker Barth
35.0k338496733
accept rate: 33%

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, 12:55) Sako
Replies hidden
1

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;
(13 Feb, 13:23) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×41
×17

question asked: 13 Feb, 12:07

question was seen: 65 times

last updated: 13 Feb, 13:24