Http://www.acnow.net/ srr0u If the modified value N does not assign or define, the original record content is cleared to NULL, it is best to perform non-empty verification before modification; http://www.acnow .NET / 3KUEOAQQ8 value N exceeds the defined length error, it is best to perform a length verification before insertion .. http://www.acnow.net/ SRR0U Notes: http://www.acnow.net/ 3kueoaqq8a. The above SQL statement has a row-level lock, http://www.acnow.net/ 3KUEOAQQ8 confirms that the command of the end of the event will be formally effective, http://www.acnow.net / 3KUEOAQQ8 otherwise change does not necessarily write into the database. Http://www.acnow.net/ 3kueoaqq8 If you want to withdraw these actions, you can use the command Rollback to recover. Http://www.acnow.net/ 3kueoaqq8 http: // www .acnow.net / 3kueoaqq8b. It is best to estimate the possible operation record range before running Insert, DELETE, and UPDATE statements, http://www.acnow.net/ 3kueoAQQ8 should be limited to smaller (10,000 records) The range is within the scope. Otherwise, Oracle handles this thing to use a big return. Http://www.acnow.net/ 3kueoaqq8 program responded slowly and even lost response. If the number of records exceed more than 100,000, you can put these SQL The statement segment is divided, http://www.acnow.net/ 3kueoaqq8 plus commit to confirm the process processing. Http://www.acnow.net/ 3kueoaqq8 http://www.acnow.net/ 3kueoaqq8 II. Data Definition (DDL) section http://www.acnow.net/ srr0u1.create (Create Table, Index, View, Synonyms, Procedures, Functions, Database Links, etc.) http://www.acnow.net/ Sr0uoracle is commonly used The field type has http://www.acnow.net/ 3kueoaqq8char fixed length string http://www.acnow.net/ 3kueoaqq8 < I> var i> Char2 variable length string http://www.acnow.net/ 3kueoaqq8number (m, n) digital m is the total length of the bit number, n is a decimal length http: // WWW. ACNOW.NET/ 3kueoaqq8date Date Type http://www.acnow.net/ SRR0U When you create a table, you should put the smaller fields in front, you may be empty in the back http: //www.acnow .NET / SRR0U can use Chinese field name when creating a table, but it is best to create a table with the field name http://www.acnow.net/ srt0u, such as the default sysdate http: //www.acnow.net/ 3kueoaqq8 This time you insert and modify, you can get the action of this field to get the action of this field http://www.acnow.net/ SRR0U to create a constraint condition HTTP : //www.acnow.net/ 3KueoAQQ8, for example, not allow repeating UNIQUE, keyword primary key http://www.acnow.net/ 3kueoaqq8 http://www.acnow.net/ 3kueoaqq82.alter (changing table, index, View, etc.) http://www.acnow.net/ SRR0U Change the name of the table http://www.acnow.net/ 3kueoaqq8alter Table Name 1 to Table Name 2;
http://www.acnow.net/ SRR0U Add a field after the table http://www.acnow.net/ 3kueoaqq8alter Table Name Add Field Name Field Name Description; http://www.acnow.net/ srr0u Modify the definition of the field in the table Description http://www.acnow.net/ 3kueoaqq8alter Table Name Modify field name field name description; http://www.acnow.net/ srt0u Plus the fields to the table with constraints HTTP: //www.acnow.net/ 3kueoaqq8alter Table Name Add constraint constraint name primary key (field name); http://www.acnow.net/ 3kueoaqq8alter Table Name add constraint constraints unique (field name); http: / /www.acnow.net/ srr0u put the table or remove the memory area of the database http://www.acnow.net/ 3kueoaqq8alter Table Name cache; http://www.acnow.net/ 3kueoaqq8alter Table Name Nocache; http://www.acnow.net/ srr0u3.drop (Delete Table, Index, View, Synonyms, Procedures, Functions, Database Links, etc.) http://www.acnow.net/ SRR0U Delete Table and All Constraints Http://www.acnow table name Cascade constraints; http://www.acnow.net/ srt0u4.truncate (all records in the empty table, the structure of the table) http://www.acnow .NET / SRR0UTRUNCATE table name; http://www.acnow.net/ srt0u III. Query statement (select) section http://www.acnow.net/ srr0Uselect field name 1, field name 2, ... from the name 1, [Table Name 2, ...] where conditions; http://www.acnow.net/ srr0u field name can be brought into functions http://www.a CNOW.NET/ 3KueoAQQ8, for example: count (*), min (field name), max (field name), AVG (field name), distinct (field name), http://www.acnow.net/ 3kueoaqq8 to_char (Date) Field name, 'YYYY-MM-DD HH24: MI: SS') http://www.acnow.net/ srt0unvl (expr1, expr2) Function http://www.acnow.net/ 3kueoaqq8 Explanation: http: // Www.acnow.net/ 3kueoaqq8if Expr1 = null http://www.acnow.net/ 3kueoaqq8 return expr2 http://www.acnow.net/ 3kueoaqq8ELSE http://www.acnow.net/ 3kueoaqq8 return expr1 http: / / www.acnow.net/ srr0udecode (AA, V1, R1, V2, R2 ....) function http://www.acnow.net/ 3kueoaqq8 explanation: http://www.acnow.net/ 3kueoaqq8if aa = V1 TEN RETURN R1 http://www.acnow.net/ 3kueoaqq8if aa =
V2 THEN RTURN R2 http://www.acnow.net/ 3kueoaqq8 .. ... http://www.acnow.net/ 3kueoaqq8ELSE http://www.acnow.net/ 3kueoaqq8return null http://www.acnow.net / srr0ulpad (char1, n, char2) function http://www.acnow.net/ 3kueoaqq8 Explanation: http://www.acnow.net/ 3kueoaqq8 Character Char1 Press the number of bits n to display, the number of insufficient bits use char2 The string is replaced on the left space http://www.acnow.net/ Sr0u field name can be arithmetic operation http://www.acnow.net/ 3kueoaqq 4, for example: (Field name 1 * field name 1) / 3 http : //www.acnow.net/ SRR0U Query statement can nested http://www.acnow.net/ 3kueoaqq8, for example: select ... from http://www.acnow.net/ 3kueoaqq 4 (Select ... from the name 1, [Table Name 2, ...] WHERE Condition 2; http://www.acnow.net/ SRR0U The results of the two query statements can be made http://www.acnow.net/ 3kueoaqq8, for example : Equation Union (deduplication), set union all (not deduplication), the difference set minus, intersection intertent http://www.acnow.net/ srr0u packet query http://www.acnow.net/ 3kueoaqq8select field name 1, field name 2, ... from table name 1, [table name 2, ...] group by field name 1 http://www.acnow.net/ 3kueoaqq8 [haVing condition]; http: // www . can.net / srr0u connection between the two tables http://www.acnow.net/ srt0Uselect field name 1, field name 2, ... from the name 1, [Table name 2, ...] Wheree Http://www.acnow.net/ 3kueoaqq8 table name 1 . Field name = Table name 2. Field name [and ...]; http://www.acnow.net/ srt0uslect field name 1, field name 2, ... from table name 1, [Table name 2, ......] Where http://www.acnow.net/ 3kueoaqq8 table name 1. Field name = table name 2. Field name ( ) [and ...]; http://www.acnow.net/ srr0u has ( ) number Field position automatic null value http://www.acnow.net/ 3kueoaqq8 http://www.acnow.net/ 3kueoAQQQ8 Query Result Set Sedimentation, the default sort is ascending ASC, descending is desc http: // Www.acnow.net/ srr0uselect field name 1, field name 2, ... from table name 1, [table name 2, ...] http://www.acnow.net/ 3kueoaqq8order BY field name 1, field name 2 DESC http://www.acnow.net/ SRR0U string Fuzzy comparison method http://www.acnow.net/ srr0uinstr (field name, 'string')>
0 http://www.acnow.net/ 3kueoaqq8 field name Like 'string%' ['% string%'] http://www.acnow.net/ SRR0U Each table has an implicit field RowID It marks the uniqueness of the record. Http://www.acnow.net/ SRR0U IV. Common data objects (Schema) http://www.acnow.net/ SRR0U1. Index (INDEX) http: / /www.acnow.net/ Srr0uCreate Index Index Name ON Name (Field 1, [Field 2, ...]); http://www.acnow.net/ 3kueoaqq8alter Index Index Rebuild; http://www.acnow The index of .NET / SRR0U is preferably not more than three (except special big sheets), it is best to use a single field index, combined with the analysis of the SQL statement, http://www.acnow.net/ 3kueoaqq8 can also Establish a combined index of multi-definitions and function-based index http://www.acnow.net/ srt0uoracle8.1.7 strings can index the maximum length of 1578 single-byte http://www.acnow.net/ 3kueoaqq8racle8.0.6 characters The maximum length of the string can index is 758 single-byte http://www.acnow.net/ SRR0U2. View (view) http://www.acnow.net/ srr0ucreate view view name as select .... From ... ..; http://www.acnow.net/ 3kueoaqq8alter View View name compile; http://www.acnow.net/ SRR0U view is just a SQL query statement, which can make a complicated relationship between the tables. HTTP: / / www.acnow.net/ srr0u3. Synonyms http://www.acnow.net/ 3kueoaqq8create synonym synonym synonym with a word name for table name; http://www.acnow.net/ 3kueoaqq8create synonym synonym word name for table name @ Database Link name; http://www.acnow.net/ SR R0U4. Database link http://www.acnow.net/ 3kueoaqq8create database link database link name Connect to username Identified by password using 'database connection string'; http://www.acnow.net/ 3kueoaqq8 http://www.acnow.net/ 3kueoAQQ8 Database Connection String You can use Net8 Easy Config or directly modify the TNSNames.orase definition. http://www.acnow.net/ SRR0U Database Parameter Global_Name = TRUE Requires Database Link Name Like the remote database name http://www.acnow.net/ SRR0U Database Global Name You can use the following commands http://www.acnow.net/ 3kueoaqq8select * from global_name; http://www.acnow.net / srr0u query the table in the remote database http://www.acnow.net/ 3kueoaqq8select ... from the table name @ database link name;