Явно чего не хватает - какого-нибудь PUT или Access;..Update()
Получилось при таком раскладе:
Код: Выделить всё
ThisWindow.InsertAction PROCEDURE
ReturnValue BYTE,AUTO
! Start of "WindowManager Method Data Section"
! [Priority 5000]
! End of "WindowManager Method Data Section"
CODE
! Start of "WindowManager Method Executable Code Section"
! [Priority 2500]
! Parent Call
ReturnValue = PARENT.InsertAction()
! [Priority 5001]
messages{PROP:SQL}='UPDATE messages SET mid=CONVERT(char(36),NEWID()) WHERE LEN(mid)=0'
Access:Messages.Update()
! End of "WindowManager Method Executable Code Section"
RETURN ReturnValue
ThisWindow.InsertAction PROCEDURE
ReturnValue BYTE,AUTO
! Start of "WindowManager Method Data Section"
! [Priority 5000]
! End of "WindowManager Method Data Section"
CODE
! Start of "WindowManager Method Executable Code Section"
! [Priority 2500]
! Parent Call
ReturnValue = PARENT.InsertAction()
! [Priority 5001]
messages{PROP:SQL}='UPDATE messages SET mid=CONVERT(char(36),NEWID()) WHERE LEN(mid)=0'
[b] Access:Messages.Update()[/b]
! End of "WindowManager Method Executable Code Section"
RETURN ReturnValue
т. е. я перенёс точку вставки и добавил Access:...
P.S. Для чего это нужно? Для единообразия. В десктопном приложении я генерировал GUID в клиентском триггере (в словаре). Сейчас делаю доступ к БД через REST API и там типичный метод добавления записи выглядит так :
Код: Выделить всё
server.route({
method : 'POST',
path : '/insertMessage/{message}',
handler : function (request, reply) {
const message = request.params.message;
console.log(message);
var req=new sql.Request(conn);
[b] req.query("INSERT INTO messages (mid, message,uid_fk) VALUES (CONVERT(char(36),NEWID()),'"+message+"',1)"[/b], function (error, results, fields) {
if (error) throw error;
console.log(results);
reply(results);
});
//reply('Yes this is MIASOFT.');
}
});
Вот и захотелось унифицировать.
p.p.s. Странно, почему-то в тэге <code> нет выделения жирным шрифтом