Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

I know that it's possible to grant public permission to UNLOAD via the -gl database option. I don't really want to do that.

Is it possible to create a procedure that puts a wrapper around my specific UNLOAD statement and then grant a specific user permission to execute that procedure?

(I'm trying, but its not working, and I'm not getting any meaninful error messages).


I'm using

asked 09 Apr '10, 20:52

Ron%20Hiner's gravatar image

Ron Hiner
accept rate: 9%

You can do this by creating a procedure owned by DBA and then grant execute permissions to the user that you want to be able to run this procedure.


CREATE PROCEDURE DBA.unload_some_data()
    select *
      from mytable
        to 'myfile.txt';

GRANT EXECUTE ON DBA.unload_some_data TO "otheruser";

This gives the user otheruser the ability to call the procedure unload_some_data and when the procedure is called, the procedure will run as user DBA and therefore will be able to unload the data (as long as you did not start the server with -gl none)

permanent link

answered 09 Apr '10, 22:57

Mark%20Culp's gravatar image

Mark Culp
accept rate: 41%

Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 09 Apr '10, 20:52

question was seen: 2,438 times

last updated: 09 Apr '10, 22:57