Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create a driver line

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you "how to create the reader line", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to create the reader line" this article.

Trigger line, the moving average of MACD. Generally only individual software will have Triggerline (represented by dotted lines). And MACD line constitute the best reference for buying or selling. Two lines are displayed in the MACD graph, one is the solid line is the MACD line, and the other line is the dashed line (Triggerline) is the moving average line of the MACD.

Create trigger reader line syntax

Create a trigger in MySQL through the SQL statement createtrigger to implement its syntax as follows:

Createtriggertrigger_name

BEFORE | AFTERtrigger_EVENT

ONTABLE_NAMEFOREACHROWtrigger_STMT

Description of the main parameters of the driver line:

Trigger_name: represents the name of the trigger to be created.

BEFORE: "before..." specifies the execution time of the trigger.

AFTER: "after" specify the execution time of the trigger.

Trigger_EVENT: represents the trigger execution condition, including the "delete,insert,update" statement.

TABLE_NAME: indicates the name of the action table that triggers the event

FOREACHROW: indicates that any action on a record that satisfies the trigger event will trigger the trigger.

Trigger_STMT: represents the statement that is executed after the trigger is activated.

1: in the student management library, when adding a piece of student information to the student table, you also need to update the class size in the class table. The specific code is as follows:

Showdatabases

Use student management

Showtables

Desc student form

Desc class table

Createtriggertrig_ class size 1

Afterinserton student table foreachrow// just inserts data into the student table and triggers the trigger.

Update Class Table set Class size = Class size + 1

Check the original number of people before viewing the student table and inserting the record:

Select*from class table

Then insert the data to view

Insertinto student form

Values ('Zhang Wei', 'B01 Jingjue' male', '19901010' Nanchang City')

Select*from class table

The query results show that the insert trigger has been executed successfully!

2: in student management, when deleting a piece of student information in the student table, you also need to update the number of classes in the class table. The specific code is as follows:

Createtriggertrig_ class size 2

Afterdeleteon Student form foreachrow

Update Class Table set Class size = Class size-1

Note: the verification method is the same as before

Create multiple triggers for executing statements: (screenshot required)

The above is all the contents of the article "how to create the reader line". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report