[MySQL] Insert the file path, the backslash disappears

series of articles

C# underlying library-MySQL script automatically builds classes (insert, update statement generation)
link to this article: https://blog.csdn.net/youcheng_ge/article/details/129179216

C# underlying library – MySQL database access operation auxiliary class (recommended reading)
link to this article: https://blog.csdn.net/youcheng_ge/article/details/126886379

C# underlying library – SQLiteHelper access operation auxiliary class
Link to this article: https://blog.csdn.net/youcheng_ge/article/details/123666958

Improve programming efficiency – data import tool
Link to this article: https://blog.csdn.net/youcheng_ge/article/details/126427323

Oracle database restricts ip access to
this article link: https://blog.csdn.net/youcheng_ge/article/details/122220930

SQL gets the database table, specifies the field and determines whether it is the primary key
Link to this article: https://blog.csdn.net/youcheng_ge/article/details/110820405

Usage of SQL outer apply
Link to this article: https://blog.csdn.net/youcheng_ge/article/details/79903489

MySQL installation tutorial (detailed)
link to this article: https://blog.csdn.net/youcheng_ge/article/details/126037520

MySQL uninstall tutorial (detailed)
link to this article: https://blog.csdn.net/youcheng_ge/article/details/129279265

How to display the "total" field when MySQL subtotals (group by...with rollup)?
Link to this article: https://blog.csdn.net/youcheng_ge/article/details/128217837

Usage of MySQL WITH CHECK OPTION
Link to this article: https://blog.csdn.net/youcheng_ge/article/details/128147196

How does MySQL use stored procedures to insert tens of millions of data to improve efficiency?
Link to this article: https://blog.csdn.net/youcheng_ge/article/details/77728189

Implementation of row and column transposition of MySQL database table
Link to this article: https://blog.csdn.net/youcheng_ge/article/details/77625052


foreword

This column is [Database], which mainly introduces the functions and characteristics of SQL, SQL data definition language (table, view, index, constraint), SQL data manipulation language (data retrieval, data insertion, data deletion, data update), creation and deletion Triggers, SQL Data Control Language (Security and Authorization, Transaction Processing), and Embedded SQL.
If you are interested in this album, keep paying attention. If you have any questions, you can also give feedback in the comment area and private message me.
insert image description here

1. Technical introduction

View definition:

The view is not a real basic table, but a virtual table

2. Test cases

2.1 Data preparation

Create user information table userinfo

        private void Form1_Load(object sender, EventArgs e)
        {
    
    
            string str = @"E:\【我的项目】\鼎禄MES系统项目模板 - 20230206\DMS - DL - GB001 - S - A - DLMESServerModule\DMS - DL - GB001 - S - A\bin\Debug\TemFile\2.pdf";
            string aa = str.Replace("\\", "\\\\\\\\");

        }

insert image description here
insert image description here

 UPDATE dl_mes.钨条样检验数据表 SET 修改人编号='root',检验结果='合格',不合格原因='',附件='E:\【我的项目】\bin\Debug\TemFile\1.pdf',备注='',修改时间='2023/4/25 11:34:38',修改人编号='root',修改内容=CONCAT(修改内容,'修改人编号:root=>root', ';') WHERE 样品编号='WT-3A0100000F-01'

insert image description here

str_File = str_File.Replace("\\", "\\\\");

3. Usage summary

WITH CHECK OPTION (with check option) means to ensure that the update, insert or delete satisfies the predicate condition in the view definition (that is, the conditional expression in the subquery) when performing update, insert, and delete operations.
For the view using WITH CHECK OPTION, for data insertion, if the data does not meet the where condition, the insertion fails with error code 1369. Has a check function.

The with check option guarantees that the modification made through the view must also be able to see the modified result through the view.
Modified results and results are only displayed on the view, so that other views will not be affected.
So if you insert, the inserted record must be visible after refreshing the view;
if it is modified, the modified result must also be visible through the view;
if it is deleted, of course only the records displayed in the view can be deleted.

Guess you like

Origin blog.csdn.net/youcheng_ge/article/details/130361131