在SQL中,”$”和”{}”的含义是什么?

huangapple go评论226阅读模式
英文:

What do the $ and { } meaning in SQL?

问题

$P{p_date} 在这个 SQL 中的作用是什么?我必须重建 SQL 查询,但不幸的是,我的前同事没有对它进行任何注释。所以,我不理解下面的代码:

SELECT * FROM table_A A INNER JOIN table_B B ON (A.key = B.key AND A.date = $P{p_date});

我认为它可能是将日期值传递给 Oracle,但我不确定。

英文:

can anyone explain $P{p_date} do in this SQL. I have to rebuild SQL query but unfortunately my previous coworker doesn't make any comment about it. So, I don't understand the code below:

SELECT * FROM table_A AINNER JOIN table_B BON (A.key = B.keyAND A.date = $P{p_date});

I think it maybe pass date value to in Oracle but I'm not sure.

答案1

得分: 1

那很可能来自于像Jasper Reports或类似的报表工具。

无论如何,它只是在说明这个查询将在运行时接收到用户提供的值,因此您的查询等效于:

SELECT * 
FROM table_A A 
INNER JOIN table_B B 
ON (A.key = B.key AND A.date = <某个用户提供的值>);
英文:

That most likely comes from a reporting tool such as Jasper Reports or similar.

In any case, it is simply saying that this query will receive a value from a user at run time, thus your query is equivalent to:

SELECT * 
FROM table_A A 
INNER JOIN table_B B 
ON (A.key = B.keyAND A.date = &lt;some user provided value&gt;);

huangapple
  • 本文由 发表于 2023年8月9日 13:10:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76864750-2.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定