Уважаемые форумчане, подскажите пожалуйста...столкнулся с проблемой:
Для копирования прав доступа создал isq_CopyRight
Но выдает следующую ошибку: "Operand type clash: int is incompatible with uniqueidentifier", никак не могу разобраться. Опыта крайне мало, поэтому прошу помощи у профессионалов.
isq_CopyRight
INSERT INTO [dbo].[tbl_CashflowRight] ([ID], [RecordID], [AdminUnitID], [CanRead], [CanWrite], [CanDelete], [CanChangeAccess])
SELECT
[tbl_CashflowRight].[CanRead] AS [CanRead],
[tbl_CashflowRight].[CanWrite] AS [CanWrite],
[tbl_CashflowRight].[CanDelete] AS [CanDelete],
[tbl_CashflowRight].[CanChangeAccess] AS [CanChangeAccess],
:OldRecordID AS [NewRecordID],
:MyAdminUnitID AS [AdminUnitID],
[tbl_CashflowRight].[ID] AS [ID]
FROM
[dbo].[tbl_CashflowRight] AS [tbl_CashflowRight]
WHERE([tbl_CashflowRight].[RecordID] = :OldRecordID AND
[tbl_CashflowRight].[AdminUnitID] = :MyAdminUnitID)
function CopyRight:
function CopyRight(OldRecordID, NewRecordID) {
var InsertSelectQuery = GetSingleItemByCode('isq_CopyRight');
var Columns = InsertSelectQuery.SelectQuery.Columns;
var ConstColumn = Columns.ItemsByAlias('NewRecordID');
ConstColumn.ColumnValue = NewRecordID;
SetParameterValue(InsertSelectQuery.Parameters, 'OldRecordID', OldRecordID);
SetParameterValue(InsertSelectQuery.Parameters, 'MyAdminUnitID',
Connector.CurrentUser.ID);
try {
InsertSelectQuery.Execute();
}
catch(e) {
CatchException(e);
}
}