code block templates for Oracle
Declare
--Declaring variables
Begin
--Execute business logic
exception
--Exception handling
End
--End
Note: The code block will have a colon at the end of each SQL statement
eg
--plsql code blocks inserting data into the database
Declare
v_id varchar (10): = ' 1 '; --declares that the string variable must be of length
V_name varchar (10): = ' Zhang San ';
V_sex integer:=1;
V_age integer:=18;
Begin--begin executing code
INSERT into a_student values (v_id,v_name,v_sex,v_age);
End
Insert Database Chinese garbled, solution
If your plsql does not have the ability to set the Chinese character set, such as my plsql developer10, that can be resolved by setting the environment variable, adding a name to the environment variable called Nls_ The lang value is your Oracle character set (such as simplified Chinese_china. ZHS16GBK) system variables, restart Plsql developer, the problem can be resolved.
Oracle code block