cursor, view, storage function and trigger usage of Mysql database
1. cursor
Using cursors to solve the problem that sql statements can't handle row records, we want to be a traversal array in java.
BEGIN
DECLARE river_id VARCHAR(32); -- Custom variable
DECLARE river_name VARCHAR(50); -- Custom variable
DECLARE done INT DEFAULT FALSE; -- Traverse d ...
Posted by duncanwil on Sun, 27 Oct 2019 04:51:29 -0700
Analysis of SQL Server Trigger and its application
I. what is trigger
trigger is a method provided by SQL server to programmers and data analysts to ensure data integrity. It is a special stored procedure related to table events. Its execution is not called by programs or started manually, but triggered by events. (--- from Baidu Encyclopedia)
Simp ...
Posted by 99degrees on Thu, 24 Oct 2019 03:53:16 -0700
Python learning journal Mysql database Chapter 9
Preface
The main function of index is to restrict and speed up the search. The ORM framework (sqlalchemy) uses classes and objects to operate the database.
Types of indexes
By category
1. General index: can speed up search
2. Primary key index: can speed up search, cannot be empty, cannot be duplicate
3. Unique index: accelerated searc ...
Posted by leightons on Mon, 21 Oct 2019 07:00:00 -0700
sql server database pushes data to java interface
Because I have never used the database to push data to the java interface before, in order to achieve this demo, I step by step step stepping on the pit!!!
The function and application scenario of this article: using database to push data actively, realizing real-time updating of front-end page dat ...
Posted by misterm on Wed, 09 Oct 2019 18:25:05 -0700
Parameters.AddWithValue("@parameter", value) method
Links to the original text: https://www.cnblogs.com/kdp0213/p/8532838.html
Differences between the cmd.Parameters.Add method and the VS Parameters.AddWithValue("@parameter", value) method
In the past, when using command method to a ...
Posted by rmt123 on Wed, 09 Oct 2019 12:47:59 -0700
pyodbc Connects MSSQL to Execute SQL Statements
Use django to connect to SQL Server, and pyodbc to connect to multiple databases.
pyodbc, the SQL that runs the query, is very simple:
import pyodbc
connection = pyodbc.connect('DRIVER={SQL Server Native Client 10.0};SERVER=127.0.0.1;DATABASE=DB_name;UID=User_Name;PWD=PassWord')
curs = connection.execute('select * from table')
#curs.fetchone( ...
Posted by temidayo on Wed, 09 Oct 2019 08:05:18 -0700
Technology Sharing | MySQL Captures Error Information during Batch Insertion
Author: Yang Taotao
background
Today's article comes from a question asked by today's customers.
Problem: I'm migrating from Oracle to MySQL, and the data has been converted to a simple INSERT statement. Because there are many statements, I don't know how to locate the wrong statement every time I import it. If there are fewer INSERT statement ...
Posted by codeman on Thu, 29 Aug 2019 02:19:02 -0700
MySQL Realizes Recursive Query
Summary
A few days ago, a client consulted about MySQL recursive query method. At that time, he had a simple understanding and felt that recursive query logic level is a special query method. However, it was later found that this is a very common query requirement, such as folding display of some comment floors, various flow charts and other re ...
Posted by Saphod on Tue, 13 Aug 2019 01:33:00 -0700
MySQL stored procedure 02
This time I'll go on to talk about MySQL stored procedures:
Let's first look at its multi-branch control structure case:
The statement of case is simple:
case variable name
when condition 1 then output result 1;
when condition 2 then outputs result 2;
......
end case;
So let's build a stored procedure to implement it:
create proce ...
Posted by starram on Fri, 09 Aug 2019 03:50:06 -0700
SQL SERVER Implementing Multi-row to Multi-column
There is such a requirement, a form main table, an extended list, query to expand the list of multi-row into the main table multi-column.
such as
dt_zhubiao [main table]
id
type
title
1
1
Form 1-1
2
1
Forms 1-2
3
2
Form 2-1
4
2
Form 2-2
dt_kuozhanbiao [Extended Table]
id
formid
name
title
value
1
1
ext_ ...
Posted by Mikersson on Fri, 09 Aug 2019 03:48:00 -0700