Build the REVOKE/GRANT statement as a string and use EXECUTE IMMEDIATE.
for example (stmt not tested )
set revokeStmt = 'REVOKE ALL on ' || tbl || 'from AUser';
EXECUTE IMMEDIATE revokeStmt;
--
Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8
************************************************** **************************
*
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!
http://www.ianywhere.com/promos/deved/index.html
************************************************** **************************
*
iAnywhere Solutions http://www.iAnywhere.com
** Please only post to the newsgroup
** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com
************************************************** **************************
*
"Bill McHugh" <wmchugh (AT) _remove_this_for_email_williamrmchugh (DOT) com> wrote in
message news:3fcfa638$1 (AT) forums-2-dub (DOT) ..
Quote:
I want to grant privileges on all the user tables in systable, but the
following gives ASA Error -141 "Table 'tbl' not found". Could someone
explain
how to do this? TIA.
FOR csr AS curs CURSOR FOR
(SELECT table_name AS tbl
FROM systable
WHERE creator = 101)
DO
REVOKE ALL on tbl from AUser;
GRANT ALL on tbl to AUser WITH GRANT OPTION;
END FOR; |