0

I'm looking for a way to grant some right (say SELECT) on all tables of one user to some other user. Something like that:

GRANT SELECT ON Username1.* to Username2

Important condition is that I need not only granting the right to all existing tables, but I also want, that all tables that will be created by Username1 by default should be granted with correspondent right to Username2

What I've done is creation a an external script for choosing all tables created by Username1:

SELECT table_name FROM systable WHERE creator IN (SELECT user_id from sysuser WHERE username='Username1')) 

and generating GRANT statements for every of them.

But than I need to execute that script as soon as new table is created. It is not really elegant to have that granting logic out of the database. I would prefer having kind of trigger within the database, but Sybase IQ does not support triggers.

Anybody have idea how to solve the problem in elegant manner?

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
ipbd
  • 524
  • 3
  • 16
  • Have you looked at groups, to see if users in the same group can access the newly created tables? – Mike Gardner Dec 10 '12 at 19:10
  • Unfortunately not. And that concerns not only users in the same group: even if a table is owned by the group itself, members of the group don't get access rights to that table by default. – ipbd Dec 11 '12 at 09:20
  • this is impossible now, maybe something will be changed int IQ 16 – slav0nic Feb 26 '13 at 09:43

0 Answers0