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
Official documentation: https://nginx.org/en/linu...
1. Log in to MySQL database mysql -u root -p View...
Anyone in need can refer to it. If you have tried...
Install PostgreSQL 11 on CentOS 7 PostgreSQL: The...
Recently, when using kazam in Ubuntu 20.04 for re...
System environment: Redis version: 6.0.8 Docker v...
With the popularization of 3G, more and more peop...
(I) Basic concepts of web page color matching (1) ...
Table of contents Defining the HTML structure Inp...
Alibaba Cloud Server installs and configures Tomc...
When developing a project, you will often encount...
Table of contents What is a slot Understanding of...
This article shares the specific code of JavaScri...
Introduction to MySQL Window Functions MySQL has ...
REPLACE Syntax REPLACE(String,from_str,to_str) Th...