How to use Oracle temporary tables flexibly

Source: Internet
Author: User

This article introduced a four user synchronization update stored procedure instance, through this example study, you may discover that the temporary table under certain condition also can be nimble and easy to use, when the data quantity is small, it does not show the temporary table speed not to be able the question.

SET QUOTED_IDENTIFIER ON

Go

SET ANSI_NULLS on

Go

/*

Name: Four-person data in the game is updated simultaneously

Designed BY:WHBO

Designed at:2005-10-12

Modified by:

Modified at:

Memo:

*/

ALTER PROC [PRMONEY_UPDATECASH2]

@chvModeName varchar (16),

@chvSourceName varchar (64),

@chvRemark varchar (128),

@intUserID1 int,

@intUserID2 int,

@intUserID3 int,

@intUserID4 int,

@intWantedAmount1 int,

@intWantedAmount2 int,

@intWantedAmount3 int,

@intWantedAmount4 int,

@chvIPAddress1 varchar (15),

@chvIPAddress2 varchar (15),

@chvIPAddress3 varchar (15),

@chvIPAddress4 varchar (15),

@inyLog tinyint

As

SET NOCOUNT ON

Set XACT_ABORT on

Declare @intCashAmount1 int, @intCashAmount2 int, @intCashAmount3 int, @intCashAmount4 int

Declare @FRate float, @FTemp float

Declare @bNeedReCalc bit--0: Do not have to be counted; 1: Need to be counted again

Set @FRate =1.0

Set @FTemp =1.0

Set @bNeedReCalc =0

Declare @FTemp1 float, @FTemp2 float, @FTemp3 float, @FTemp4 float

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.