Oracle function (converts the first letter of each word to uppercase)
NLS_INITCAP (x [, y])
[Function] returns a string and converts the first letter of the string to uppercase, And the other letters to lowercase;
[Parameter] x struct expression
/* Obtain the pinyin corresponding to the name of the Oracle function */
Create or replace function F_GET_PY (V_XM varchar) RETURN VARCHAR2 ISS_py varchar2 (100 );Z_hz varchar2 (2 );Z_py varchar2 (10 );I number (3 );I _jls number (5 );BEGINS_py: = ''
An example of a simple Oracle function returning an array [zz]
Create or replace type t_ret_table is table of varchar2 (20 );
Create or replace function f_test (var_num in integer) return t_ret_table isVar_out t_ret_table;BeginVar_out: =
I. Introduction
A Function is a named storage program that can contain parameters (with or without parameters) and return values.
The structure of a function is similar to that of a process, but a RETURN clause must be provided to RETURN the
Random generation of code (repeated judgment) (oracle function)
Create or replace function generate_coupons_code (v_length in number: = 16) return varchar2 is v_code varchar2 (70); type t_arr is varray (16) of varchar2 (1); char_arr t_arr; flag
Forcibly obtain the next value of the sequence/current value (oracle function)
For more information about how to use a function to obtain the sequence value, see here.
-- Create or replace function get_seq_next (seq_name in varchar2) return
oracle| Function | Data pl/sql code:
CREATE OR REPLACE PACKAGE "SCOTT". " Pkg_test "as
TYPE Myrctype is REF CURSOR;
FUNCTION get (Strbarcode VARCHAR) return myrctype;
End Pkg_test;
CREATE OR REPLACE PACKAGE Body "SCOTT". Pkg_test "as
FUNCTION get
If the table structure corresponds to only one field, you can select col1 bulk collect into variable without a cursor loop, simple and efficientCreate or Replace function Get_airway_subpoint (awid in number)Return Airway_subpnts_tab is--create OR
Basic usage:Lpad functionFunction IntroductionThe Lpad function is an Oracle database function, and the Lpad function populates the string with the specified character from the left. From its literal meaning can also be understood, L is the left
In the actual work, will inevitably encounter serial number generation problem, the following is a simple sequence number generation function(1) Create a custom serial number configuration table as follows:---Custom sequence CREATE table S_autocode (
Sql> Select substr (' Liuyuehui ', 3) as first_name from dual;First_Name--------------UyuehuiSql> Select substr (' Liuyuehui ', 1) as first_name from dual;First_Name------------------LiuyuehuiSql> Select substr (' Liuyuehui ', 0) as first_name from
IamlaosongToday see a MD5 encryption problem, many languages have provided encryption functions, Oracle also provides MD5 encryption function, online search, encryption function is:Dbms_obfuscation_toolkit. MD5 (input_string = ' abc ')However, there
1. Wmsys.wm_concat functionConvert columns to rows. Example:-The table data is as follows sql> select * from IDTable; ID NAME---------------------------------------- Ten ab BC CD hi 20 ij The execution
Chartorowid (C1)"Feature" Conversion varchar2 type is ROWID value"Parameter" c1, string, string of length 18, string must conform to ROWID format"Return" returns the ROWID value"Example" Select Chartorowid (' aaaadeaabaaaazsaaa ') from DUAL;
PL/SQL single-line functions and group functionsA function is a program that has 0 or more parameters and has a return value. Oracle has built a series of functions in SQL, which can be called SQL or PL/SQL statements, and functions are divided into
A function was created in Oracle that originally wanted to return an index table without success. Think of text can also transfer information, suddenly came to the inspiration, the return value to set the text format.Given that the amount of return
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.