Oracle PL/SQL Tutorial/SQL PLUS Session Environment/define

Материал из SQL эксперт
Перейти к: навигация, поиск

Define name

SQL>
SQL> define table_name="&1";
Enter value for 1: set linesize 78;
SQL> prompt &table_name
set linesize 78;
SQL> desc &table_name
Usage: DESCRIBE [schema.]object[@db_link]
SQL> set linesize 1000;
SQL> undefine table_name
SQL>
SQL>


Define variable

SQL>
SQL> variable x number
SQL> variable y varchar2(8)
SQL>
SQL> execute :x := 7566
PL/SQL procedure successfully completed.
SQL> execute :y := "ADMIN"
PL/SQL procedure successfully completed.
SQL>
SQL> print x y
     X
------
  7566

Y
--------------------------------
ADMIN
SQL> variable
variable   x
datatype   NUMBER
variable   y
datatype   VARCHAR2(8)
SQL>
SQL>