<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://sqle.ru/index.php?action=history&amp;feed=atom&amp;title=Oracle_PL%2FSQL_Tutorial%2FPL_SQL_Programming%2FVariable_Scope</id>
		<title>Oracle PL/SQL Tutorial/PL SQL Programming/Variable Scope - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://sqle.ru/index.php?action=history&amp;feed=atom&amp;title=Oracle_PL%2FSQL_Tutorial%2FPL_SQL_Programming%2FVariable_Scope"/>
		<link rel="alternate" type="text/html" href="http://sqle.ru/index.php?title=Oracle_PL/SQL_Tutorial/PL_SQL_Programming/Variable_Scope&amp;action=history"/>
		<updated>2026-07-15T09:02:33Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://sqle.ru/index.php?title=Oracle_PL/SQL_Tutorial/PL_SQL_Programming/Variable_Scope&amp;diff=4035&amp;oldid=prev</id>
		<title> в 13:45, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://sqle.ru/index.php?title=Oracle_PL/SQL_Tutorial/PL_SQL_Programming/Variable_Scope&amp;diff=4035&amp;oldid=prev"/>
				<updated>2010-05-26T13:45:46Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 13:45, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://sqle.ru/index.php?title=Oracle_PL/SQL_Tutorial/PL_SQL_Programming/Variable_Scope&amp;diff=4036&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://sqle.ru/index.php?title=Oracle_PL/SQL_Tutorial/PL_SQL_Programming/Variable_Scope&amp;diff=4036&amp;oldid=prev"/>
				<updated>2010-05-26T10:08:26Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Controlling scope with a variable declaration==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;By definition, the scope of a variable is a region of a program unit from which you can reference the variable.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A variable is local to the block where it is declared.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A variable is global to all sub-blocks of the block where it is declared.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In the following code, variable V_STR1_main is local for the block labeled &amp;lt;&amp;lt;MAIN&amp;gt;&amp;gt; and global for the&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;block labeled &amp;lt;&amp;lt;SUB&amp;gt;&amp;gt;. Variable V_STR1_sub is visible only in the block &amp;lt;&amp;lt;SUB&amp;gt;&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
SQL&amp;gt; &amp;lt;&amp;lt;MAIN&amp;gt;&amp;gt;&lt;br /&gt;
  2  declare&lt;br /&gt;
  3      v_str1_main VARCHAR2(10);&lt;br /&gt;
  4  begin&lt;br /&gt;
  5      v_str1_main :=&amp;quot;ABC&amp;quot;;              -- local&lt;br /&gt;
  6      &amp;lt;&amp;lt;SUB&amp;gt;&amp;gt;&lt;br /&gt;
  7      declare&lt;br /&gt;
  8          v_str1_sub VARCHAR2(1);&lt;br /&gt;
  9      begin&lt;br /&gt;
 10          v_str1_main:=&amp;quot;ABC&amp;quot;;           -- local&lt;br /&gt;
 11          v_str1_sub:=&amp;quot;A&amp;quot;;             -- global and visible&lt;br /&gt;
 12      end;&lt;br /&gt;
 13      v_str1_main :=&amp;quot;ABC&amp;quot;;              -- local&lt;br /&gt;
 14  end;&lt;br /&gt;
 15  /&lt;br /&gt;
PL/SQL procedure successfully completed.&lt;br /&gt;
SQL&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Scope Rules==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;Scope means the range of code within which a given identifier can be referenced.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;An identifier can be referenced only by code executing inside the block in which the identifier was declared.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;An identifier could be a variable name, or a procedure name, function name.&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following example illustrates the scope of various identifiers.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON&lt;br /&gt;
SQL&amp;gt; DECLARE&lt;br /&gt;
  2    a_name  VARCHAR2(30) := &amp;quot;James&amp;quot;;&lt;br /&gt;
  3  PROCEDURE name_print IS&lt;br /&gt;
  4  BEGIN&lt;br /&gt;
  5    DBMS_OUTPUT.PUT_LINE(a_name);&lt;br /&gt;
  6  END;&lt;br /&gt;
  7&lt;br /&gt;
  8    BEGIN&lt;br /&gt;
  9       DBMS_OUTPUT.PUT_LINE(a_name);&lt;br /&gt;
 10    DECLARE&lt;br /&gt;
 11       b_name  VARCHAR2(30) := &amp;quot;Jenny&amp;quot;;&lt;br /&gt;
 12&lt;br /&gt;
 13     BEGIN&lt;br /&gt;
 14         DBMS_OUTPUT.PUT_LINE(&amp;quot;Inside nested block&amp;quot;);&lt;br /&gt;
 15         DBMS_OUTPUT.PUT_LINE(a_name);&lt;br /&gt;
 16         DBMS_OUTPUT.PUT_LINE(b_name);&lt;br /&gt;
 17         name_print;&lt;br /&gt;
 18     END;&lt;br /&gt;
 19     DBMS_OUTPUT.PUT_LINE(&amp;quot;Back in the main block&amp;quot;);&lt;br /&gt;
 20     --b_name is not defined in this block.&lt;br /&gt;
 21     --DBMS_OUTPUT.PUT_LINE(b_name);&lt;br /&gt;
 22     name_print;&lt;br /&gt;
 23  END;&lt;br /&gt;
 24   /&lt;br /&gt;
James&lt;br /&gt;
Inside nested block&lt;br /&gt;
James&lt;br /&gt;
Jenny&lt;br /&gt;
James&lt;br /&gt;
Back in the main block&lt;br /&gt;
James&lt;br /&gt;
PL/SQL procedure successfully completed.&lt;br /&gt;
SQL&amp;gt;&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>