Trigger learning Summary
Note: The size of the trigger cannot be more than32K.
Create table emp_trigger
As
Select * from emp
Create or replace TRIGGERPrint_salary_changes
Before delete or insert or update on emp_trigger
FOR EACH ROW
WHEN
Compare the resource consumption of bind variables and unbind variables first initialize data Createtabletstsasselectlevelascol1, rdbms_random.string (p, 10) ascol2fromdualconnectbylevel10000; %% rowtype; beginforiin1. 100
Compare the resource
[Oracle] display connect by, oracleconnect
1. Display by organizational structure relationship
Create or replace view v_vieworgSelect -- v. OBJID, v. OBJNAMELevel as levelid,Lpad ('', 2 * level-2) | v. OBJNAME as OBJNAME, v. OBJID, v. OBJCODE,
Oracle creates a view and opens permissions to users. To improve query efficiency, you can consider opening a view for users in other companies. www.2cto.com 1. create or replace view test_table_v as select t1, t2, t3, t4, t5 from test_table 2.
I believe everyone has met the lock table. I think everyone knows how to unlock the table. However, there are some low-level kill processes. We use stored procedures to implement this function.
I believe everyone has met the lock table. I think
Oracle copy tables, temporary tables, and viewsCreate a new_table table with the same structure as the old_table Table (no old_table Records)
Create table new_table as select * from old_table where 1 = 0;
Create a new_table table with the same
The problem I encountered is that the previously submitted task is still running, so I will not execute the same task again. The number of concurrent tasks set by Oracle is limited. Therefore
The problem I encountered is that the previously
Create two-table join query views in Oracle
In project development, multi-table queries are sometimes used, and there are many methods, such as association, such as views. However, View queries are the fastest for queries, if your database has a
Date interval: year, month, day, hour, minute, second, interval: Year
Create a test table:
Create or replace view v ASSELECT TO_DATE ('1970-1-1 13:14:15 ', 'yyyy-MM-DD HH24: MI: ss') AS c from dual; SELECT * FROM v;
Subtract two dates to get
Removes unnecessary characters from a string.
The employee name contains the vowel (AEIOU), which must be removed now.
Create a test table:
Create or replace view v ASSELECT 'clark' AS ename from dualunion allselect 'King' AS ename from dualunion
Sort values in different columns based on conditionsSometimes the ordering requirements are complex. For example, if a leader is more interested in employees with salaries between 1000 and 2000 yuan, the employees with salaries in this range must be
Sort by calculated column and calculate Column
If you want to sort the calculated columns, you can specify aliases for the calculated columns and then sort them by aliases.
Create a test table:
Create or replace view v ASSELECT 3 AS a, 4 AS B
Description: DECODE (condition, value 1, translation value 1, value 2, translation value 2 ,... value n, translation value n, default value) the meaning of this function is as follows: IF condition value 1 THENRETURN (translation value 1) ELSIF
Many customers have their own database servers to manage their important data. What if we need to use the data in our project and the customer cannot insert the data to our project database server? One solution is to create some table or view
Triggers, oracle triggersDirectory
I. DML triggers
Ii. INSTEAD_OF trigger
Iii. system triggers
4. Delete trigger modify trigger status close open
-- Description -- 1. BEFORE the event (BEFORE) AFTER the event (AFTER) -- 2. trigger Condition Clause
The reason why the oracle task process is not executed after it is submitted
/* Run the following command in SQL * Plus */-- check steps when the task is not running -- 1. check whether the instance session is RESTRICTED by select instance_name,
High Availability Analysis of MySQL: MySQL HA solution
For most applications, MySQL is the most critical data storage center. Therefore, we have to deal with the problem of how to make MySQL provide the HA service. When the master is running, we
When I created a view under a scott user, the following error was reported: The permission is insufficient. I was helpless when I encountered this problem. so I collected the information online and shared it with you. I hope to help you.
When I
The Oracle view does not have a primary key by default. Therefore, when you use hibernate to generate a java class in reverse direction, a composite primary key is automatically used to generate a class with the class name + ID, which makes it
Today, we mainly describe how to minimize the planned downtime of DB2 9.7 database online mode changes when modifying database objects. We all know that IBM®DB2®9.7 introduces new enhancements that allow you to change database objects and ensure
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.