SQL single-line functions in Oracle databases-character FunctionsThis learning is about character functions.Character FunctionsCharacter functions can also be divided into case-insensitive conversion functions and character processing functions.Case-sensitive conversion func
Tags: calculate high-precision modified address EFI struct arithmetic uname table structureSQL queries and SQL functions This chapter aims Understanding Oracle Data Types Understanding Data Definition Languages and data manipulation languages Understanding Transaction Control Languages and Data Control languages Mastering
I. oracle basic SQL statements and functions, and oraclesql Functions
I. Data Definition Language (ddl)
Data definition language (ddl) is used to change the database structure, including creating, changing, and deleting database objects.
The Data Definition Language commands used to manipulate the table structure inclu
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/
Oracle Database SQL single-row functions-date functionsPrefaceThe date functions of the Oracle database are very powerful and relatively large. I will sort it out for future reference.. Convenience for yourself and convenience for others!Common date functions1. Sysdate: curr
SQL single-row functions in Oracle databases-continued character FunctionsI practiced some character functions in the previous blog, and then I went to the next blog to read the relevant materials.The character function has not been practiced yet. This time, we mainly perform some supplementary exercises on some unused
Mathematical functions of Oracle SQL functionsABS (x) "function" returns the absolute value of x "parameter" x, numeric Expression "return" numeric SQL> SELECT ABS ( -), ABS (- -) from DUAL; ABS ( -) ABS (- -)---------- ---------- - -Sign (x) "function" returns the positive negative value of X "parameter" x, nu
few weeks of each yearTo_char (sysdate, ' mm ') the first few months of each yearTo_char (sysdate, ' Q ') the first quarter of each yearTo_char (sysdate, ' yyyy ') yearSql> Select To_char (sysdate, ' PM yyyy-mm-dd hh24:mi:sssss AD year Mon day ddd iws ') from DUAL;To_char (sysdate, ' Pmyyyy-mm-ddh--------------------------------------------------------------------------------Morning 2008-03-27 09:58:35917 A.D. thousand eight March Thu 087 13Sql> SELECT to_char (Systimestamp, ' HH24:MI:SS. FF5 '
Oracle pl/SQL common functions, oracleplsql Functions
On csdn, I also saw a post called Oracle common function 110. after a rough look, there are many data calculations, such as covariance. I don't think I have used much. I can see it today, but it is not very comprehensive.
],c3]) "function" converts a string X to a numeric type "parameter" c2,c3, character type, reference To_char () "Return" number string "reverse" to_char (DATE[[,C2],C3]) "Example" SelectTo_number ('199912'), To_number ('450.05') fromdual; To_multi_byte (C1) "function" converts half-width in a string to full-width "parameter" C1, character "return" string "Example" SQL>SelectTo_multi_byte ('High A') text fromdual; test--High A To_single_byte (C1) "func
SQL date functions
-- DATEADD-- Returns a new datetime value based on a specified date.-- DATEADD (datepart, number, date)-- Abbreviation of date-- Year yy, yyyy-- Quarter qq, q-- Month mm, m-- Dayofyear dy, y-- Day dd, d-- Week wk, ww-- Hour hh-- Minute mi, n-- Second ss, s-- Millisecond MSSELECT dateadd (mm, 5, '2014/1/8080') as date -- DATEADD-- Returns a new datetime value based on a specified date.-- D
SQL single-row functions in Oracle databases-numeric Functions1. trigonometric FunctionsSIN ASIN SINHCOS ACOS COSHTAN ATAN TANHFor the above trigonometric functions, see the name. Do a continuous exercise [SQL] select sin (2), asin (1), SINH (1) from dual;Select cos (1), ACO
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/
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
the X field type SQL>SelectMax (distinct Sal), Max (XM) fromTable3; Max (distinctsal) max (XM)---------------- --------5555.55zhumin ([Distinct|all]x) The maximum value of the row x column is selected in the function statistics table. The "parameter" all means the maximum value for all values, distinct only the maximum value for the different values, the default is all if there is a parameter distinct or all, a space is separated from the X (column).
Functions in oracle are divided into character functions, number functions, date functions, empty processing functions, conversion functions, and other common
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) {String driver= "Oracle.jdbc.driver.OracleDriver";String ur
1.System Variable Functions
(1)Sysdate
This function returns the current date and time. The current date and time of the Oracle server are returned.
Select sysdate from dual; insert into purchase values ('smallwidget ', 'sh', sysdate, 10); insert into purchase values ('meduem wodget', 'sh', sysdate-15, 15 );
To view all sales records in the last 30 days, run the following command:
Select *
Syntax for building functionsCreate or Replace function name (parameter input or output parameter type) return data typeis return value data type of return valueBeginAction to be done by the functionEndSQL Statement Demo:Create or Replace function My_fun (in_no in number) is Out_name VARCHAR2 (64);BeginSelect Ename to Out_name from EMP where emp.empno=in_no;return out_name;End My_fun;Note: There is no longer end my_fun and end;Function call:DeclareVar_name VARCHAR2 (32);BeginVar_name:=my_fun (73
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.