page258
345
result += "GRANT USAGE
ON SCHEMA tpc.share_owner_" + P_CLIENT_NAME + " TO SHARE share_" +
P_CLIENT_NAME + ";\n\n"
result += "/* Entitle new role to create objects in the new schema */\n"
result += "GRANT USAGE
ON SCHEMA tpc.share_owner_" + P_CLIENT_NAME + " TO ROLE share_owner_
role;\n"
result += "GRANT CREATE TABLE
ON SCHEMA tpc.share_owner_" + P_CLIENT_NAME + " TO ROLE share_owner_
role;\n"
result += "GRANT CREATE VIEW
ON SCHEMA tpc.share_owner_" + P_CLIENT_NAME + " TO ROLE share_owner_
role;\n"
result += "GRANT CREATE MATERIALIZED VIEW
ON SCHEMA tpc.share_owner_" + P_CLIENT_NAME + " TO ROLE share_owner_
role;\n"
result += "GRANT CREATE DYNAMIC TABLE
ON SCHEMA tpc.share_owner_" + P_CLIENT_NAME + " TO ROLE share_owner_
role;\n\n"
/* Fetch client curated objects */
sql_stmt = "SELECT client_account,\n"
sql_stmt += " object_name,\n"
sql_stmt += " client_sql_statement\n"
sql_stmt += "FROM v_client_sql_statement\n"
sql_stmt += "WHERE client_name = :1;"
stmt = snowflake.createStatement( { sqlText: sql_stmt, binds:[P_CLIENT_
NAME] } );
try
{
recset = stmt.execute();
while(recset.next())
{
client_account = recset.getColumnValue(1);
Chapter 9
Client expeCtations