首页 \ 问答 \ SQLite INSTEAD OF TRIGGER(SQLite INSTEAD OF TRIGGER)

SQLite INSTEAD OF TRIGGER(SQLite INSTEAD OF TRIGGER)

我想转换此Microsoft SQL Server触发器

ALTER TRIGGER [dbo].[trg_EliminoItems]
ON [dbo].[PedidosEncabezado]
INSTEAD OF DELETE
AS
BEGIN

    SET NOCOUNT ON;

    insert into HistPedidosEncabezado select * from PedidosEncabezado where PedidosID in ( select PedidosID from deleted )
    insert into HistPedidosItems select * from PedidosItems where PedidosID in ( select PedidosID from deleted )

    delete from PedidosItems where PedidosID in ( select PedidosID from deleted )
    delete from PedidosEncabezado where PedidosID in ( select PedidosID from deleted )

END

进入SQLite。


I want to convert this Microsoft SQL Server trigger

ALTER TRIGGER [dbo].[trg_EliminoItems]
ON [dbo].[PedidosEncabezado]
INSTEAD OF DELETE
AS
BEGIN

    SET NOCOUNT ON;

    insert into HistPedidosEncabezado select * from PedidosEncabezado where PedidosID in ( select PedidosID from deleted )
    insert into HistPedidosItems select * from PedidosItems where PedidosID in ( select PedidosID from deleted )

    delete from PedidosItems where PedidosID in ( select PedidosID from deleted )
    delete from PedidosEncabezado where PedidosID in ( select PedidosID from deleted )

END

into SQLite.


原文:https://stackoverflow.com/questions/18447044
更新时间:2023-07-25 06:07

最满意答案

C / C ++预处理器将替换写入同一行的所有内容。 在你的情况下,它看起来好像这个模式之后的两个标记本身就是宏,所以它们也会被扩展。

一些例子:

#define F(x, y) x f(y yParam);
#define G(x, y) y g(x xParam);
#define FG(x, y) F(x, y) G(x, y);

FG(int, double)

//this is the same as:
int f(double yParam);
double g(int xParam);

在你的情况下,我猜这两个定义了X_FROM _...和X_TO _...分别创建了一些函数或类,这些函数或类是处理程序用于将X传递给某个总线或传递给某些总线。 XHANDLER宏将为这两个方向创建处理程序。


The C/C++ preprocessor will replace the pattern for everything that is written in the same line. In your case it looks as if the two token after that pattern are themselves macros, so they will get expanded as well.

Some example:

#define F(x, y) x f(y yParam);
#define G(x, y) y g(x xParam);
#define FG(x, y) F(x, y) G(x, y);

FG(int, double)

//this is the same as:
int f(double yParam);
double g(int xParam);

In your case I guess the two defines X_FROM_... and X_TO_... create some functions or classes that are handlers for passing an X from or to some bus, respectively. The XHANDLER macro will create handlers for both directions.

相关问答

更多
  • tl; dr:如果你写了一个超过20个字符的regex你做错了什么,但它可能是一个可接受的黑客。 如果你写一个超过50个字符的regex ,你需要立即停止。 我首先要说的是,这绝不应该由正则表达式来解决。 您描述的大多数步骤应该在预处理或后处理中处理。 你不应该尝试提出一个过滤掉以Deleted tweet或RT开头的东西的regex ,你应该在预处理中忽略这些行。 忽略unicode ? 然后可能值得上网,因为互联网上的所有内容,以及记事本以外的所有内容都是unicode。 如果你想删除所有无法在asci ...
  • 可以将函数作为设置的第一个参数传递(代替静态URL。)如果您可以通过jQuery获得用户输入,那么您最好创建一个自定义函数来模式匹配并生成相关URL串。 即 $(document).ready(function() { $("#search_frwId").tokenInput(getMyRestServer, { theme: "facebook", queryParam : "param" }); }); function getMyRestServer ...
  • hasNext(pattern)尝试将指定模式与整个标记进行匹配。 字符串“abcd12345abcd”没有分隔符,因此它构成一个标记。 你的模式寻找由单个数字组成的令牌,这显然不匹配。 另一方面, findInLine(pattern)尝试在行中的任意位置查找模式,因此找到的第一个数字将匹配。 hasNext(pattern) attempts to match the specified pattern against entire tokens. The string "abcd12345abcd" ...
  • C / C ++预处理器将替换写入同一行的所有内容。 在你的情况下,它看起来好像这个模式之后的两个标记本身就是宏,所以它们也会被扩展。 一些例子: #define F(x, y) x f(y yParam); #define G(x, y) y g(x xParam); #define FG(x, y) F(x, y) G(x, y); FG(int, double) //this is the same as: int f(double yParam); double g(int xParam); ...
  • 我不想回答自己的问题,但我找到了答案,也许它可以帮助未来的人。 我的问题是默认的标记器,它会在将文本传递到我的过滤器之前分割文本。 通过添加我自己的标记器,它将默认分离器"\W+"覆盖为"[^\\w-]+" ,我的过滤器接收到整个单词,并因此创建了权限令牌。 这是我现在的自定义设置: curl -XPUT 'localhost:9200/test_index' -d '{ "settings": { "analysis": { "filter": { ...
  • 你是对的, token_pattern需要一个自定义的正则表达式模式,传递一个正则表达式,它将任何一个或多个不包含空格字符的字符视为一个单一的标记。 tfidf = TfidfVectorizer(lowercase=False, token_pattern=r'\S+') tf_idf_matrix = pd.DataFrame( tfidf.fit_transform(dataset['des']).toarray(), columns=tfidf.get_feature_names ...
  • when警卫引用单个案例时,不管有多少个模式组合在一起。 案件需要分开: let foo = function | Some (0, x) when x > 0 -> "bar" | None -> "bar" | _ -> "baz" 出于这个原因,将返回值分解可能会更好,因此不会重复可能的复杂表达式: let foo value = let ret = "bar" match value with | Some (0, x) when x > 0 -> ret | None ...
  • 通常不会,因为在大多数实现中,令牌仅在每次身份验证时生成一次(即,当有人登录时)。 通常仍建议每个会话仅生成一次CSRF令牌。 一旦BREACH攻击检索到CSRF令牌,它就可以用于会话中的后续请求。 如果值是加密的并不重要,因为它只是所需的密文本身。 但是,作为BREACH的缓解,您可以在每个请求上重新生成令牌。 这里还有其他一些缓解措施 。 我最喜欢的是当referer标头与您的域不匹配时禁用HTTP压缩,或者是空白,因为这不会破坏系统的任何功能。 对于高安全性系统,最好为HTTPS请求完全禁用HTTP压 ...
  • . 已经为我工作了三十年。 你一定做错了别的事。 但我建议: . return yytext[0]; 这将匹配除了换行符之前尚未与先前规则匹配的任何字符,并将其返回到解析器以进行处理,解析器的错误恢复。 注意你应该在解析器中处理一元减号,而不是扫描器。 . has been working for me for thirty years. You must have done something else wrong. But I suggest: . return yytext[0]; That wi ...
  • 这是一条正确的道路! 为了我, 用户发送他的电子邮件,我发送了一个生成GUID的令牌,我有一个passwordResetTokenDate ,用户请求重置日期。 (令牌有效48小时) 在电子邮件中,有一个令牌链接,我给他一个令牌,如果他点击并出现问题,他可以复制粘贴在文本框中的令牌或重新点击链接 当他点击链接时,我检查令牌和日期和passwordResetTokenDate如果一切正确,则检查日期和passwordResetTokenDate 。有两个文本框,用户输入他的新密码的2倍。 当他保存密码时,我记 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。