Tag:stored procedure
-
Time:2021-1-14
MySQL stored procedure 1. Create stored procedure syntax (format) DELIMITER $ Create procedure stored procedure name a (in passes in parameter name a int, in passes in parameter name B varchar (20), out returns parameter name C int) BEGIN Content END $ Analysis: In represents the incoming parameter, defines the name of the incoming parameter, […]
-
Time:2020-10-29
SQL Server batch export stored procedures In the query analyzer, select database, right-click task, and select generate script from the pop-up menu ——》”Next step” — “select the database where you want to store the procedure” “Next step” — check “stored procedure” and “next step” Check the name of the stored procedure you want to generate, […]
-
Time:2020-10-28
IF EXISTS (SELECT name FROM sysobjects WHERE name = N’cg_DoBackupJob’ AND type = ‘P’) DROP PROCEDURE cg_DoBackupJob GO CREATE PROCEDURE [cg_DoBackupJob] @DataBaseName varchar(100), @FileHead varchar(50), @Isfullbackup bit, – 0 differential backup 1 full backup @FolderPath varchar(50) = ‘f:\db_backup\’, @Backname varchar (100) =’unknown ‘, — description string @Isappendmedia bit = 1 — 0overlay media 1 append […]
-
Time:2020-10-27
This paper describes the Oracle stored procedure cursor usage. For your reference, the details are as follows: Five steps to use a cursor 1. Declare variables to hold the index returned by the select statement2. Declare the cursor and specify the select statement3. Open cursor4. Get record from cursor5. Close cursor Get each record from […]
-
Time:2020-10-26
This paper describes the Oracle stored procedure loop syntax. For your reference, the details are as follows: 1. Simple cycle grammar loop statements; end loop; example: counter := 0; loop counter := counter + 1; exit when counter = 5; end loop; Note: the exit statement immediately ends the loop, and the exit when statement […]
-
Time:2020-8-20
Create a process on your hard disk test.sql create or replace procedure test_bf is begin dbms_output.put_line(‘test success’); end; Then the procedure is encrypted by using Oracle’s own wrap command First open the CMD and then enter the command wrap iname=’input_name’ oname=’output-name’ input_ Name is the path of the file to be encrypted, output_ Name is […]
-
Time:2020-8-16
This paper describes the Oracle stored procedures, functions and triggers. For your reference, the details are as follows: 1、 Stored procedures and stored functions It refers to the subroutines stored in the database for all user programs to call, called stored procedures and stored functions. Create stored procedure Use the create procedure command to create […]
-
Time:2020-6-25
summary The procedure and function (usually called subprogram) in PL / SQL is a special type of PL / SQL block. This kind of subprogram can be stored in the database in the form of compilation and called for the subsequent block. Same point: program to complete specific functions Difference: use return statement to return […]
-
Time:2020-6-9
The example of this article describes the usage of loop statements (while, repeat and loop) of MySQL stored procedures. To share with you for your reference, as follows: MySQL provides loop statements, which allow us to execute a SQL code block repeatedly according to conditions. There are three loop statements: while, repeat and loop. Let’s […]
-
Time:2020-6-6
Inadvertently, I saw an article written by my friend, “the implementation of the stored procedure for batch generation of insert statements from the data in the table”. I look at the two storage codes in this article carefully. I feel that they are not very satisfied with each other. They are all generated single line […]
-
Time:2020-6-5
Sometimes, we need to export all the data in a certain table or according to the query criteria and migrate it to another database with the same structure At present, there is no relevant tool in SQL server to generate insert statements based on query criteria, only with the help of the third party tools […]
-
Time:2020-5-29
This paper introduces the principle and usage of MySQL stored procedure. To share with you for your reference, as follows: A stored procedure contains a series of executable SQL statements. Stored procedures are stored in MySQL. By calling its name, you can execute a pile of SQL inside it Advantages of stored procedures #1. It […]