-- for each TargetDb table give the user select right
SELECT 'GRANT SELECT
ON ' !! TableName !! ' TO userName
WITH GRANT OPTION ;
'
FROM dbc.tables
WHERE DataBaseName = 'TargetDb' ;
-- for each Cou chDb table create a new one in TargetDb
-- by copying the couch db
SELECT '
DATABASE TargetDb ;
CREATE TABLE ' !! TableName !! '
AS (
SELECT * FROM TargetDb.' !! TableName !! '
) WITH DATA;'
FROM dbc.tables
WHERE DataBaseName = 'TargetDb' ;
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!