Create a variable in Oracle

What is the Oracle equivalent of this MS SQL Server notation?

DECLARE @Variable INT SET @Variable = 1 
+4
source share
2 answers

In PL / SQL, you have a declaration block:

 declare x integer := 1; ... begin ... end; 

If you write an SQL * Plus script, you use variable to declare a variable

 variable x integer := 1; 

It is also possible to define variables.

+3
source

In PL / SQL:

 DECLARE a number; BEGIN a := 1; END; 

You can paste this code into SQLPlus to run it.

+2
source

Source: https://habr.com/ru/post/1307943/


All Articles