如果我在r中使用getsql从文件夹中读取查询,但是在查询中,请采用Oracle参数,该如何处理?

发布于 2025-02-09 07:03:57 字数 378 浏览 1 评论 0原文

这是我的文件夹的设置。

.. 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 in
if (!is.null(params) & length(params[params$param == v, "default"]) > : argument is of length zero

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文