Informix 使用参数定义 INTERVAL
我正在 Informix 中执行以下操作来删除超过 20 秒的行。
delete from sometable
where someDateColumn < (current - interval (20) second to second);
但是,我想在存储过程中配置间隔,但我做不到
CREATE PROCEDURE i_hate_informix (prm_timeframe int)
DELETE sometable
WHERE someDateColumn < (current - interval (prm_timeframe) second to second);
END PROCEDURE;
I am doing the following in Informix to delete rows more than 20 seconds old.
delete from sometable
where someDateColumn < (current - interval (20) second to second);
However, I want to make the interval configurable in a stored procedure, but I can't do
CREATE PROCEDURE i_hate_informix (prm_timeframe int)
DELETE sometable
WHERE someDateColumn < (current - interval (prm_timeframe) second to second);
END PROCEDURE;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己找到了答案。
不能使用变量动态定义间隔。 但是你可以使用“单位秒”,这样我的程序就变成了
I found the answer myself.
Interval can not be defined dynamically with a variable. But you can use "units second" so my procedure becomes