Reprint Address: Http://www.2cto.com/database/201212/177382.html the features and functions of a custom Function (UDF) www.2cto.com functions can be divided into return strings, integers or real numbers; can define a simple function
Flexible use of 2 functions charindex and PATINDEX and wildcard charactersFunctions: Charindex and PATINDEXCHARINDEX: Checks if a character (string) is contained in another string, and returns the starting position of the specified expression in the
Auto-Define Sequence number: Used to do "Order No."There will always be such a demand, but you may not have encountered it. Let me give an example: if the order number is generated in the form "date + serial number"(Whether the demand is stupid or
Syntax:
New:
Create function function_name (argument list) returns return value type
function body
The function name, which should be a valid identifier, and should not conflict with an existing keyword.
A function should
MySQL Stored procedure creation syntax
The code is as follows
Copy Code
CREATE PROCEDURE and create FUNCTION CREATE PROCEDURE sp_name ([proc_parameter[,...]]) [Characteristic ...] Routine_body CREATE FUNCTION sp_name
javascript, as with other object-oriented languages, object types take the form of references. The variable holding the object is only an address, and the base type data is a value. When you store objects on a prototype, there may be traps
Several flat MySQL functions commonly used
/*****************************************************
1. Judge whether the string is a Chinese character return value: 1-Chinese characters 0-non-Chinese characters
**************************************
Functions of JavaScript
Author: F. Permadi
Translator: Sheneyan (Zi Wu)
Time: 2006.01.03
English Original: INTRODUCTION to JavaScript functions
Sub-note: A pretty good entry for function, personal feeling is quite classic.
Several common MySQL functions, MySQL to judge Chinese characters, dates, numbers of specific functions to share with you, the specific contents are as follows
1. Judge whether the string is a Chinese character return value: 1-Chinese characters
SQL Server table-valued function and scalar-valued function define the way and call difference
SQL stored procedures often need to call some functions to make the process more reasonable, you can also make functions more reusable, but when writing
One, using a temporary table as an array
Copy Code code as follows:
Create function F_split (@c varchar), @split varchar (2))
Returns @t table (col varchar (20))
As
Begin
while (CHARINDEX (@split, @c) <>0)
Begin
"Custom Functions" is our usual term, and "user-defined Functions" is a written version of SQL Server.
SQL Server 2000 allows users to create custom functions, and custom functions can have return values.
Custom functions are divided into:
1. Scalar function: The result is a single value that can contain the logical processing process. It is not possible to use nondeterministic system functions such as GETDATE ().
Copy Code code as follows:
--Scalar value function
-- ====
Chinese Pinyin Whole spelling
The code is as follows
Copy Code
--Create a Chinese phonetic control temporary tableCREATE TABLE IF not EXISTS ' T_base_pinyin ' (' Pin_yin_ ' varchar (255) CHARACTER SET GBK not NULL,' Code_
"Custom Functions" is our usual term, and "user-defined Functions" is a written version of SQL Server.
SQL Server 2000 allows users to create custom functions, and custom functions can have return values.
Custom functions are divided into:
Such issues can also be extended to invoicing-like batch calculations, which also focus on other historical records to determine the status of a current record.SQL statements cannot easily implement similar functions of an MDX statement, and must be
server| Sample | data
Example of tree data processing in SQL Server 2005--Create test dataif exists (SELECT * from dbo.sysobjects WHERE id = object_id (n ' [TB] ') and OBJECTPROPERTY (ID, n ' isusertable ') = 1)drop table [TB]Go
--Sample dataCREATE
When Binlog records stored programs (stored procedures, stored functions, triggers, events), there may be a problem: statement replication mode: 1, a statement on master and slave will affect different records. 2, slave end of the SQL thread in the
--Tree Data query Example--Author: Jiangjian
if exists (SELECT * from dbo.sysobjects WHERE id = object_id (n ' [TB] ') and OBJECTPROPERTY (ID, n ' isusertable ') = 1)drop table [TB]GO
--Sample dataCREATE TABLE [TB] ([id] int identity (+), [PID]
MySQL implements a sequence similar to Oracle
2013-10-22 10:33:35 I'm going to say two footsteps.
MySQL implements Oracle-like sequence Oracle general use sequence (Sequence) to handle primary
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.