Get the App
SLTechnology News&Howtos  ›  Development  › 

How to create a driver line

Shulou Source: shulou.com Published: 2022-06-03 11:02:01 09月15日 Update

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!

Tags: Class student trigger number of people sentence content student management article management event code information and at the same time data time dotted line grammar learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Linux Microsoft Shulou Technology Shulou Tech Info