Label:Temporary tables and table variables can play a "temporary" role, so what are the main differences between the two?This is not discussed here, as well as the global temporary table, the session temporary table these, the main record of the individual on the main difference between the two and the application of the view, there is nothing wrong or complement
divided into local and global two, the name of the surface variable is "@" prefix, only in the local current user connection can be accessed. The name of the global table variable is prefixed with "@@", which is generally the global variable of the system, as we commonly use, such as @ @Error represents the wrong number, @ @RowCount represents the number of rows affected.1. Why to use Table variablesTable
I. Temporary table space contraction
1.1 Description
About Oracle's temporary tablespace, a blog has been collated before:
Oracle Temp temporary table space
http://blog.csdn.net/tianlesoftware/article/details/4697417
The following operations can take up a large amount of temporary:
1, users perform IMP/EXP Import export operations, will use a large number of te
procedure into the staging table.INSERT into #tmp EXEC procedure_name @parameters_var3. You can now use (filter, change, or retrieve) #tmp了. ^_^IF EXISTS (SELECT * from #tmp)BEGIN--Execution Branch 1END ELSE BEGIN--Execution Branch 2END or SELECT * from #tmp WHERE ...4. Don't forget to finally clear the temp table.DROP TABLE #tmp for dynamic SQL statements, just
MySQL Stored Procedure Transaction Management and mysql Stored Procedure transaction
ACID: Atomic, Consistent, Isolated, Durable
A storage program provides an excellent mechanism to define, encapsulate, and manage transactions.
1. MySQL transaction support
MySQL transaction support is not bound to the MySQL server it
Introduction to Oracle Stored Procedure instances and oracle Stored Procedure instances
This document introduces the stored procedure through the imported table.
The difference between
pdm_cust_act_behav_base 201003 | grep-v OI_RETURN | grep-v-| while read vi_resultDo# This dateEcho $ vi_resultIf [$ vi_result-eq 0]ThenEcho "this produre is normal run"ElseEcho "this produre is not normal run"FiDone
3. Related stored procedures and table creation scripts (this can be used as a template. This is a template of a large company, haha)
A. Stored
Global temporary represents a globally temporary tableMetadata for temporary tables is stored in the data dictionaryAllocate space for a segment of this table only when the first DML command occursThe visible range of temporal table data should be session level or transaction levelThe on commit keyword determines when a session or transaction level is built, on c
Assume the table structure
Create Table Table_1
(
Tid int identity (1, 1 ),
Number int
)
1. Call a stored procedure without parameters or returned values
Assume that the stored procedure is as follows:
Create PROC proc_1
AS
Insert
temporary table is stored in the temporary tablespace (temp) of the Oracle system ).2. Create a temporary tableCreate an oracle temporary table. There are two types of temporary tables: Session-level temporary tables and transaction-level temporary tables.1) Session-level temporary
The simplest way to debug the stored procedure in Mysql is to debug the stored procedure in mysql.
My colleague told me to use a temporary table to Insert variable data for viewing, but this method is too troublesome, and Mysql does not have a good tool for debugging
default charset = utf8; 1112 13 drop procedure if exists proc_test_exce; 14 create procedure proc_test_exce (15 IN uid INT (11), 16 IN uname VARCHAR (255), 17 IN uscore INT (11 ), 18 OUT result INT (11) 19) 20 BEGIN 21 -- declare exit handler for sqlstate '000000' set result =-1; 22 declare exit handler for sqlwarning, not found, SQLEXCEPTION set result =-1; 23 start transaction; 24 insert into course (id,
Mysql stored procedure function trigger, mysql Stored ProcedureMysql stored procedure and function Stored Procedure download demo
Mysql> delimiter // -- here // modify the default delim
Tutorials on basic functions and triggers in the MySQL stored procedure, mysql Stored Procedure
Common functions of MySQL stored procedures
I. string typeCHARSET (str) // returns the string Character SetCONCAT (string2 [,...]) // connection stringINSTR (string, substring) //
An extended stored procedure calls another stored procedure, example:Called stored procedure: Finally, a cursor is returned, and the cursor returns a value. The stored
Although I often hear about the stored procedure, I have never used any of the projects I have encountered. I am very depressed. I have to choose my own Quick Start and share with you. I hope you can do that as well. First of all, the environment I use is windowxpmysql5, which should be available to everyone. If not, install it. After installation, do not forget to put the path directory of mysql.exe
Althou
Mysql stored procedure, cursor, transaction instance details, mysql Stored Procedure
Detailed description of mysql stored procedures, cursors, and transaction instances
The following is a mysql database stored
http://www.itpub.net/forum.php?mod=viewthreadtid=1776483pid=21223451page=1extra=# pid21223451
In the actual project, it is often necessary to invoke the cursor returned by another stored procedure in one stored procedure, and this article enumerates two situations to describe the specific operation method.
The first
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.