Variables defined by declare and @set are often seen in stored procedures. In simple terms, the declare definition is similar to a local variable, @set a similar global variable defined.
1. Declare-defined variables are similar to local variables
The declare and typeset commands are the built-in commands for Bash, both of which are exactly the same, used to declare shell variables and to set the properties of the variables.The Declare command (alias typeset) is a shell built-in command for
You may not know, define, declare, initialize, declare Initialization
Declaration definitions are everywhere, but they are not as simple as they are.First, from a broad perspective, a declaration contains a definition, which can also be referred to
Linux bash Shell's declare declare or typeset built-in commands (which are exactly the same) can be used to constrain the properties of a variable. This is a way to use a less restrictive definition type in some programming languages. Command
compiler compiles a program, it compiles only one source file and generates the corresponding intermediate file (for the VC, the. obj file), and then the connector unifies all intermediate files to form an executable file. The problem is that when
Experimental environmentCommand descriptionThe declare and typeset commands are bash's built-in commands (BUILTIN commands), both of which function exactly the same way to set variable values and properties.Typeset is now deprecated and replaced by
The Declaration tells the compiler some information to assist the compiler in syntax analysis and avoid compiler errors. The definition is to tell the compiler to generate some code that will be used by the connector. That is, the Declaration is for
1. PS1: (set the prompt character)
This is interesting. You can customize your own prompt;
Every time we press the [enter] key to execute a command, the prompt character will appear again, and we will take the initiative to read the variable
/**//*
-- Create a table
Create table student (
Recordid number (38 ),
Sid int not null,
Sname varchar2 (50 ),
Sdate date,
Sage number (3)
);
*/
-- Delete a table
-- Drop table student;
-- Insert data
/**//*
Set serveroutput on -- allow server
Original: http://www.cnblogs.com/GavinDai/archive/2011/10/24/2222735.htmlWe are in the program design, always use the definition of variables and the declaration of variables, but sometimes we are not very clear about the concept, know how it is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.