Summary of common Oracle errors

Source: Internet
Author: User
1. Oracle is case sensitive. 2. trim (

1. Oracle is case sensitive. 2. trim (

1. Oracle is case sensitive.

2. trim ('aa bb cc. ') removes spaces at the beginning and end of the string without removing spaces at the center.

3. Columns cannot be enclosed by single quotation marks ('') when listing aliases. Select empno employee number, ename name... from emp;

4. When creating a function or procedure, note that the _ xxx format cannot be used for parameters. This format will cause errors.

5. Note that the following format cannot be used when creating a package or package:
Begin is not available. You need to remove begin.
Create or replace package handle_student
Is
Begin

Functions...
Procedures...

End;

6. when writing packages and packages, you must pay attention to all the functions in the package. The name of the stored procedure and the parameter names and parameters must be exactly the same as those defined in the package, otherwise, an error occurs.

7. When writing a function or stored procedure, the parameter type cannot be set. For example

Create or replace function query_data (id number (3), name varchar2 (20), address varchar2 (20 ));

This definition is incorrect.

8. When testing a function, if you use the type of a custom parameter, You need to define the parameter range. The format is as follows:
Declare

S_name varchar2 (20); -- This specifies the parameter range. If emp. dname % type is used, it is not required because the definition already contains the range.
S_age number (3 );
S_address varchar2 (30 );
R number;
Begin
S_name: = & s_name;
S_age: = & s_age;
S_address: = & s_address;
R: = handle_student.add_emp (name => s_name, age => s_age, address => s_address );
If r = 1 then
Dbms_output.put_line ('insert successful! ');
Else
Dbms_output.put_line ('insertion failed! ');
End if;
End;

For more information about Oracle, see the Oracle topic page? Tid = 12

,

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.