当我们使用它时 := 在 oracle 中是什么意思
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18080532/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does := mean in oracle when we use it
提问by Mainakh Bhattacharjee
What does := mean in oracle when we use it Please give me some demonstrations... and also how do we usually use a dynamic query in a stored procedure in oracle...
当我们使用它时,:= 在oracle 中是什么意思请给我一些演示...以及我们通常如何在oracle 的存储过程中使用动态查询...
回答by ChrisProsser
:= is the assignment operator in PL/SQL (Oracle's procedural extension to SQL). You use this to assign values to variables. If you just use = then this is checking for equality rather than assigning a value.
:= 是 PL/SQL(Oracle 对 SQL 的过程扩展)中的赋值运算符。您可以使用它来为变量赋值。如果您只是使用 = 那么这是检查相等性而不是分配值。
Here is a very simple example using the assignment operator to assign values to variables:
这是一个非常简单的示例,使用赋值运算符为变量赋值:
Declare
v1 number;
v2 number;
res number;
Begin
--initialise values
v1 := 2;
v2 := 2;
res := v1 + v2;
dbms_output.put_line(res);
end;
I think you will need to be a bit more specific about what you want to know about dynamic SQL. As the comment above suggests, it would also be best to raise one thread per question as these are unrelated.
我认为您需要更具体地了解您想了解的有关动态 SQL 的内容。正如上面的评论所暗示的那样,最好为每个问题提出一个线程,因为它们是不相关的。