Oracle code block

Source: Internet
Author: User

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

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.