5

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

DECLARE @Variable INT
SET @Variable = 1

2 Answers 2

4

In PL/SQL, you have a declare block:

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

If you are writing an SQL*Plus script, you use variable to declare a bind variable

variable x integer := 1;

It's also possible to define variables.

Sign up to request clarification or add additional context in comments.

Comments

2

In PL/SQL:

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

You can paste this code in SQLPlus to run it.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.