What is the difference between := and = in Oracle PL/SQL

Yue Harriet Huang picture Yue Harriet Huang · Aug 21, 2014 · Viewed 20k times · Source

I want to know in Oracle PL/SQL,

= can be used for Boolean comparison, can it be used for assignment as well?

While is := used for variable initialization, can it be used for assignment too?

Then, so what is the difference between the use of 2?

Thanks!

Answer

= is the equality comparison operator, both in PL/SQL and SQL. := is the PL/SQL value assignment operator.

These are analogous to == and = in C-derived languages.

Share and enjoy.