使用 :1、:2、:3 等的 PL/SQL 代码
这段代码的含义是什么以及您如何称呼这个方法? 我如何知道 :1、:2、:3 等的值是多少?
(PL/SQL 过程)
UPDATE tablename
SET column = :1, column = :2, column = :3, column = :4, column= :5....
What is the meaning of this code and what do you call this method?
How will I know what is the value for :1, :2, :3 and so on?
(PL/SQL Procedure)
UPDATE tablename
SET column = :1, column = :2, column = :3, column = :4, column= :5....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是在 SQL*Plus 中吗?
如果是这样,它们是参数占位符。 SQL*Plus 将在执行时提示您输入值。
如果您来自 SQL 客户端/编程语言(Java、PHP、C# 等),这些通常表示准备好的语句中的参数,但我不确定仅数字占位符是否有效。
更新
这也可能出现在使用
OPEN-FOR-USING
声明。在没有看到更多代码的情况下,我只是猜测。Is this in SQL*Plus?
If so, they are parameter placeholders. SQL*Plus will prompt you for values upon execution.
If you're coming from a SQL client / programming language (Java, PHP, C#, etc) these would usually represent parameters in a prepared statement though I'm not sure if digit only placeholders are valid.
Update
This can also appear in dynamic SQL executed using an
OPEN-FOR-USING
statement. Without seeing more of your code, I'm only guessing.这些是绑定变量。 Oracle 将它们替换为传递的实际值。这些通常在您使用动态 SQL< /a>,
立即执行
, 或开放使用
作为菲尔提到。如果您想知道那里保存了哪些值,您可能需要查找 UPDATE 语句的发出位置和位置。在发出 UPDATE 语句之前将它们记录到日志记录/调试表
Those are bind variables. Oracle substitutes them for actual values which are passed. These are generally found when you're using Dynamic SQL,
EXECUTE-IMMEDIATE
, OROPEN-FOR-USING
as mentioned by Phil.If you want to know what values are being held there, you probably would wnat to look up where the
UPDATE
statements are being issued & log them to a logging/debugging table just before theUPDATE
statement is issued