Defined in tcl/ad-scope.tclif scope is not set in the topmost environment then public scope is assumed. if scope=group it assumes group_id is set in the topmost environment and if scope=user it assumes that user_id is set in topmost environment and if scope=table it assumes on_which_table and on_what_id are set in topmost environment. ad_scope_sql returns values that need to be inserted in an insert statement. e.g. if scope=group this proc will return '$scope', $group_id