如果我在r中使用getsql从文件夹中读取查询,但是在查询中,请采用Oracle参数,该如何处理?
这是我的文件夹的设置。
.. sqlqueryfolder .. city.sql
这是查询: 从国家 /地区选择 * 其中日期=:日期
我想从sqlqueryfolder获取查询,那里的city sql是接受oracle参数,我在目录中。我在我的r脚本中使用了此问题。
日期< - '01-June-22'Qry
< - getsql(“城市”, 日期=日期)
但是,当我尝试将输入日期分配给查询中的日期时,会出现错误。这是错误 错误中 if(!is.null(params)& length(params $ params $ param == v,“ default”])>:参数为长度零
This is the setup of my folder.
..sqlqueryfolder
..city.sql
This is the query :
SELECT * FROM Country
WHERE dates = :dates
I want to get the query from the sqlqueryfolder where the city sql is that accepts an oracle parameter and I am in the directory.I use this in my R script.
dates <-‘01-June-22’
Qry <- getSQL(“city”,
dates=dates )
However when I try to assign the input dates to dates in the query it is giving an error. This is the error
Error inif (!is.null(params) & length(params[params$param == v, "default"]) > : argument is of length zero
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论