Oracle 11g's dependence judgment reaches the field level, oracle11g

Source: Internet
Author: User

Oracle 11g's dependence judgment reaches the field level, oracle11g

In Oracle 10 Gb, the dependency only reaches the object level. That is to say, once the object accessed by the Stored Procedure changes, Oracle sets the stored procedure to INVALID. Therefore, after you perform DDL operations on the table, you need to re-compile the stored procedure.

In Oracle 11g, the dependency judgment is more detailed and the field level is determined. Although such a good feature exists, I suggest you recompile the stored procedure after performing DDL operations on the table.

Oracle 10 GB:

SQL> select * from v $ version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-64bi
PL/SQL Release 10.2.0.1.0-Production
CORE 10.2.0.1.0 Production
TNS for 64-bit Windows: Version 10.2.0.1.0-Production
NLSRTL Version 10.2.0.1.0-Production
SQL> drop table TEST purge;
SQL> drop PROCEDURE P_TEST;
SQL> CREATE TABLE TEST (ID NUMBER );
SQL> CREATE OR REPLACE PROCEDURE P_TEST
BEGIN
Insert into test (ID) VALUES (100 );
END;
/
SQL> col OBJECT_NAME format a10;
SQL> col OBJECT_TYPE format a10;
SQL> col STATUS format a10;
SQL> SELECT OBJECT_NAME, OBJECT_TYPE, STATUS FROM USER_OBJECTS WHERE OBJECT_NAME = 'P _ test ';
OBJECT_NAM OBJECT_TYP STATUS
------------------------------
P_TEST PROCEDURE VALID
SQL> ALTER TABLE TEST ADD (NAME VARCHAR2 (30 ));
SQL> SELECT OBJECT_NAME, OBJECT_TYPE, STATUS FROM USER_OBJECTS WHERE OBJECT_NAME = 'P _ test ';
OBJECT_NAM OBJECT_TYP STATUS
------------------------------
P_TEST PROCEDURE INVALID

Under Oracle 11g:
SQL> select * from v $ version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
PL/SQL Release 11.2.0.1.0-Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0-Production
NLSRTL Version 11.2.0.1.0-Production

SQL> drop table TEST purge;
SQL> drop PROCEDURE P_TEST;
SQL> CREATE TABLE TEST (ID NUMBER );
SQL> CREATE OR REPLACE PROCEDURE P_TEST
BEGIN
Insert into test (ID) VALUES (100 );
END;
/

SQL> col OBJECT_NAME format a10;
SQL> col OBJECT_TYPE format a10;
SQL> col STATUS format a10;
SQL> SELECT OBJECT_NAME, OBJECT_TYPE, STATUS FROM USER_OBJECTS WHERE OBJECT_NAME = 'P _ test ';
OBJECT_NAM OBJECT_TYP STATUS
------------------------------
P_TEST PROCEDURE VALID
SQL> ALTER TABLE TEST ADD (NAME VARCHAR2 (30 ));
SQL> SELECT OBJECT_NAME, OBJECT_TYPE, STATUS FROM USER_OBJECTS WHERE OBJECT_NAME = 'P _ test ';
OBJECT_NAM OBJECT_TYP STATUS
------------------------------
P_TEST PROCEDURE VALID
Oracle 11g table fields

ORACLE uses the number type.

Int is provided to be compatible with SQL standards.

You can use it.

When the oracle 11g client is opened using pl/SQL, all fields in the data table with Chinese characters are encoded? Now

-- Query the current character set information of the server.
Select USERENV ('language') l from dual;

First, query the character set of the database server.

You need to set the character set of the client to be consistent with/compatible with the character set of the server.
 

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.