Because of the knowledge of the JS of Zhou Niu, I will share the initial stage of writing the storage process under SQL
In the database world, in the SQL,DB, Oracle three databases, by writing a storage process to enhance or change the function of the business is a means, the increased flexibility of the database is self-evident. Let me introduce the writing of the stored procedure below.
The essence of a database stored procedure is a set of defined code and SQL that is deployed on the database side:
Let's take a look at our paging storage instance:
For example, the contents of the table car are as follows
Numbered title price
001 BMW $30000
002 BENZ $31000
Instance 1: Stored procedures for querying the contents of a table car
Copy Code code as follows:
Create proc Baidu_car
As
SELECT * FROM car
Go
EXEC Baidu_car
Example 2: Add a record to the table car
Copy Code code as follows:
Create proc Insert_car
@param1 Char, @param2 varchar, @param3 money
With encryption---------encryption
As
Insert car (number, name, price) Values (@param1, @param2, @param3)
Go
Example of execution:
exec insert_car ' 008 ', ' Lamborghiri ', 100000
Go