This article mainly introduces the analysis of the process of obtaining the returned data from the stored procedure in sql. The sample code in the article is very detailed and has a certain reference value for everyone's study or work. Friends in need can refer to it. After executing the storage, the data of the stored procedure execution is obtained and used as a secondary function for other applications. In fact, the code can be said to be similar to the call, the specific operations are as follows: Create a stored procedure: use [library name] go set ansi_null on GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE DBO.P_TEST ( @RBACK VARCHAR(20) OUT -- here out means what needs to be returned) AS BEGIN TRY SET @RBACK= (SELECT 2+2) END TRY The above script returns a result of 2+2 equals 4. How to call it externally, or in other stored procedure scripts, is as follows: declare @RBACK VARCHAR(20) EXEC library name.dbo.P_TEST @REBACK OUT SELECT @REBACK Execution returns 4, so it can be used more flexibly. It will be much more convenient in the later work. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Windows Server 2019 IIS10.0+PHP(FastCGI)+MySQL Environment Construction Tutorial
>>: A complete record of the process of building mobile applications using Vue Native
The vue project implements an upgraded version of...
In the actual project development process, the pag...
Web design, according to personal preferences and ...
The sudo command allows a trusted user to run a p...
Angular Cookie read and write operations, the cod...
System environment: Win10 64-bit MySQL version: m...
How to create a Linux virtual machine in VMware a...
Set the width of the body to the width of the wind...
Vue - implement the shuttle box function, the eff...
Table of contents Overview 1. Compositon API 1. W...
This article shares the implementation method of ...
Table of contents 1. Prepare data Create a data t...
Collapsed headers are a great solution for displa...
Step 1: Ensure that MySQL has binlog enabled show...
A. Installation of MySQL backup tool xtrabackup 1...