IF (Exists(select Table_name from SysTable where LCase(Table_name)=LCase('v_RegBaseServicesPeriodForOazis'))) THEN delete from InformPermission where RelationN=(select N from Relations where TableName='v_RegBaseServicesPeriodForOazis'and ColName='__OPTIONS__'); f1: for f1 as curs scroll cursor for Select grNo=N from AdminGroups do if grNo <> 0 then insert into InformPermission(N,RelationN,AdminGroupNo,Stoinost) values((select MAX(N+1) from InformPermission),(select N from Relations where TableName='v_RegBaseServicesPeriodForOazis'and ColName='__OPTIONS__' ),grNo,1); end if; end for; END IF; GO IF (Exists(select Table_name from SysTable where LCase(Table_name)=LCase('v_NonPayedServicesByContract'))) THEN delete from InformPermission where RelationN=(select N from Relations where TableName='v_NonPayedServicesByContract'and ColName='__OPTIONS__'); f1: for f1 as curs scroll cursor for Select grNo=N from AdminGroups do if grNo <> 0 then insert into InformPermission(N,RelationN,AdminGroupNo,Stoinost) values((select MAX(N+1) from InformPermission),(select N from Relations where TableName='v_NonPayedServicesByContract'and ColName='__OPTIONS__' ),grNo,1); end if; end for; END IF; GO IF (Exists(select Table_name from SysTable where LCase(Table_name)=LCase('v_UsedServicesByContract'))) THEN delete from InformPermission where RelationN=(select N from Relations where TableName='v_UsedServicesByContract'and ColName='__OPTIONS__'); f1: for f1 as curs scroll cursor for Select grNo=N from AdminGroups do if grNo <> 0 then insert into InformPermission(N,RelationN,AdminGroupNo,Stoinost) values((select MAX(N+1) from InformPermission),(select N from Relations where TableName='v_UsedServicesByContract'and ColName='__OPTIONS__' ),grNo,1); end if; end for; END IF; GO IF (Exists(select Table_name from SysTable where LCase(Table_name)=LCase('v_CrossServices'))) THEN delete from InformPermission where RelationN=(select N from Relations where TableName='v_CrossServices'and ColName='__OPTIONS__'); f1: for f1 as curs scroll cursor for Select grNo=N from AdminGroups do if grNo <> 0 then insert into InformPermission(N,RelationN,AdminGroupNo,Stoinost) values((select MAX(N+1) from InformPermission),(select N from Relations where TableName='v_CrossServices'and ColName='__OPTIONS__' ),grNo,1); end if; end for; END IF; GO IF (Exists(select Table_name from SysTable where LCase(Table_name)=LCase('v_CrossBaseServices'))) THEN delete from InformPermission where RelationN=(select N from Relations where TableName='v_CrossBaseServices'and ColName='__OPTIONS__'); f1: for f1 as curs scroll cursor for Select grNo=N from AdminGroups do if grNo <> 0 then insert into InformPermission(N,RelationN,AdminGroupNo,Stoinost) values((select MAX(N+1) from InformPermission),(select N from Relations where TableName='v_CrossBaseServices'and ColName='__OPTIONS__' ),grNo,1); end if; end for; END IF; Go IF (Exists(select Table_name from SysTable where LCase(Table_name)=LCase('v_CrossServicesContracts'))) THEN delete from InformPermission where RelationN=(select N from Relations where TableName='v_CrossServicesContracts'and ColName='__OPTIONS__'); f1: for f1 as curs scroll cursor for Select grNo=N from AdminGroups do if grNo <> 0 then insert into InformPermission(N,RelationN,AdminGroupNo,Stoinost) values((select MAX(N+1) from InformPermission),(select N from Relations where TableName='v_CrossServicesContracts'and ColName='__OPTIONS__' ),grNo,1); end if; end for; END IF; Go IF (Exists(select Table_name from SysTable where LCase(Table_name)=LCase('v_CrossBaseServicesContracts'))) THEN delete from InformPermission where RelationN=(select N from Relations where TableName='v_CrossBaseServicesContracts'and ColName='__OPTIONS__'); f1: for f1 as curs scroll cursor for Select grNo=N from AdminGroups do if grNo <> 0 then insert into InformPermission(N,RelationN,AdminGroupNo,Stoinost) values((select MAX(N+1) from InformPermission),(select N from Relations where TableName='v_CrossBaseServicesContracts'and ColName='__OPTIONS__' ),grNo,1); end if; end for; END IF; Go IF (Exists(select Table_name from SysTable where LCase(Table_name)=LCase('v_TouristsWithTur'))) THEN delete from InformPermission where RelationN=(select N from Relations where TableName='v_TouristsWithTur'and ColName='__OPTIONS__'); f1: for f1 as curs scroll cursor for Select grNo=N from AdminGroups do if grNo <> 0 then insert into InformPermission(N,RelationN,AdminGroupNo,Stoinost) values((select MAX(N+1) from InformPermission),(select N from Relations where TableName='v_TouristsWithTur'and ColName='__OPTIONS__' ),grNo,1); end if; end for; END IF; GO IF (Exists(select Table_name from SysTable where LCase(Table_name)=LCase('v_New_StatisticsByCountry2'))) THEN delete from InformPermission where RelationN=(select N from Relations where TableName='v_New_StatisticsByCountry2'and ColName='__OPTIONS__'); f1: for f1 as curs scroll cursor for Select grNo=N from AdminGroups do if grNo <> 0 then insert into InformPermission(N,RelationN,AdminGroupNo,Stoinost) values((select MAX(N+1) from InformPermission),(select N from Relations where TableName='v_New_StatisticsByCountry2'and ColName='__OPTIONS__' ),grNo,1); end if; end for; END IF;