the return value VAR salary number; exec:salary:=get_sal (7369); PRINT salary; Mode two: Call function directly in SQL statement SELECT get_sal (7369) from DUAL; way three: Use Dbms_output call function SET serveroutput on EXEC Dbms_output.put_line (' Wages are: ' | | get_sal (7369));Delete functions drop function get_sal;
Create a PackageA package is a PL/
Oracle SQL writes a method to determine whether a string is a function in the target string based on requirements. Used to identify the following situations: Determine whether string A exists in string B separated by commas (,), f
string to a date in Oracle12. To_number converts a character to a digital sql> select To_number (') ' year from dual; Year---------201713.to_multi_byteConverts single-byte characters in a string to multibyte characters, or half-width to full-widthSql> Select To_multi_byte (' Zhang ') from dual;To_multi_b----------ZhangGreatest and LEASTgreatest returns the maxi
As a result of project requirements, SQL Server must be converted to Oracle, some SQL Server views using the IsNull function, the following several Oracle functions and IsNull have a similar effect:
NVL (EXPR1,EXPR2) If EXPR1 is null, returns the value of EXPR2, otherwise r
FinlandPst PDT Pacific Standard TimeYst ydt Yukon Standard Time
Character functions supported by Oracle and Their Microsoft SQL Server equivalent functions:
Functions: Oracle Microsoft SQL
Single-record functions in SQL
1. ASCIIReturns the decimal number corresponding to the specified character;
SQL> select ASCII ('A') A, ASCII ('A') A, ASCII ('0') zero, ASCII ('') space from dual;
A A zero space
------------------------------------
65 97 48 32
2. CHRReturns the corresponding characters;
SQL> select CHR
format is as follows:
Instr (source string, the string to be searched, and the start position)
Select instr ('this is line one', 'line', 1) from dual;
The return value is the position where the substring first appears in the source string. The return value in the preceding example is 9.
Select item_desc, instr (item_desc, ',', 1) from item_test;
(5)Ltr
SQL intercepts a string and replaces it. Use sqlreplaceREPLACE to replace all the second given string expressions in the first string expression with the third expression.
SQL intercepts a string and replaces it. Use
Label:To create a function: Create or Replace function My_fun (in_no in number) return VARCHAR2 isOut_name VARCHAR2 (64);BeginSelect Ename to Out_name from EMP where emp.empno=in_no;return out_name;End My_fun; Java Program Demo: Import java.sql.CallableStatement;Import java.sql.Connection;Import Java.sql.DriverManager;Import java.sql.SQLException;Import Java.sql.Types; public class Javacallmath {public static void Main (string[] args) {
Due to development needs, I want to implement some common prompts. For example, the prompt message content is: "The XXX value YYY is incorrect. Please check and enter it again !", Then, the general information should be: "{0} value {1} is incorrect. Please check and enter it again !". But how can I Replace "{0}" and "{1? In.. net, the String has a String. format function, so that we can easily replace diffe
Tags: number start default starting point how many XXX aggregate numeric parameter descriptionString functionsIn developing T-SQL, it is often necessary to perform a variety of operations on strings, and the following describes commonly used string functions. 1. ASCII ASCII code to get characters The ASCII code is the standard encoding of the character. To get
SQL string functions, including many operations such as space-removing functions to retrieve substrings, function strings, comparison functions, string operations, function data type conversion
Tags: style blog http io ar os using SP strongTurn to view original http://www.cnblogs.com/andy2005/archive/2007/12/04/981864.htmlOnly SQL functions can be used to manipulate fields in a SELECT statement (linked to SQL Server), select field 1 from Table 1 where field 1. IndexOf ("cloud") = 1; The reason this statement is not correct is that the indexof () functio
Only SQL functions can be used in a SELECT statement to manipulate fields (linked SQL Server).
Select field 1 from Table 1 where field 1. IndexOf ("cloud") = 1;
The reason this statement is not correct is that the indexof () function is not a SQL function, and it can be changed to a
Tags: style io os using AR strong data Art spOnly SQL functions can be used to manipulate fields in a SELECT statement (linked to SQL Server).Select field 1 from Table 1 where field 1. IndexOf ("cloud") = 1;The reason this statement is not correct is that the indexof () function is not an SQL function, so it can be cha
relationship
3 From_str characters, then the length of From_str map, to_ The extra part of STR doesn't matter.
Special case: In the map, a character in the from_str, mapped to more than one character in To_str, whichever is the first.
Examples are as follows:
1. From_str= ' BCD ', to_str= ' mn ' mapping relationship: B-->m c-->n D does not map, and when replaced, the D character in string is deleted. Equivalent to deleting
2. from_str=
This article is a transcript of the programmer's SQL code, which will explain the string functions of SQL Server.
In fact, the database, like the Program language library, will integrate many APIs that can be used. These APIs, if you are familiar with it, will reduce the processing operations at the code level.
I thi
future queries.
SQL string functions
String functions perform different operations on binary data, strings, and expressions. This type of function applies to Char, varchar, binary, and varbinary data types, and data types that can be implicitly converted to Char or varchar.
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.