开发者

Create Variable In Oracle

开发者 https://www.devze.com 2022-12-28 15:57 出处:网络
What is the Oracle equivalent of开发者_StackOverflow社区 this MS SQL Server notation? DECLARE @Variable INT

What is the Oracle equivalent of开发者_StackOverflow社区 this MS SQL Server notation?

DECLARE @Variable INT
SET @Variable = 1


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.


In PL/SQL:

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

You can paste this code in SQLPlus to run it.

0

精彩评论

暂无评论...
验证码 换一张
取 消