how to declare multiple variables in one line in oracle plsql block how to declare multiple variables in one line in oracle plsql block oracle oracle

how to declare multiple variables in one line in oracle plsql block


No idea why you'd intentionally make your code less readable, but just... put them on one line:

set serveroutput onDECLARE  A integer :=10;B integer :=5;BEGIN  dbms_output.put_line(a ||':'|| b);END;/anonymous block completed10:5

The semicolon is a statement separator within PL/SQL and it doesn't matter whether or not you have whitespace or new lines; unlike plain SQL run in SQL*Plus, say, where a new statement after a separator does have to be on a new line, but that's a client thing.

Maybe you mean something else though...


no, this is the way it works in PLSQL.