Go to: http://database.51cto.com/art/201011/232267.htm
Similar to other database systems, Oracle string connections use the "| |" string concatenation, which is used in the same way as the plus sign "+" in MSSQLServer.
For example, execute the following SQL statement:
SELECT ' work number is ' | | fnumber| | ' The employee's name is ' | | FName from T_employee
WHERE FName is not NULL
In addition to the "| |", Oracle supports string concatenation using the concat () function, such as executing the following SQL statement:
SELECT CONCAT (' Work number: ', fnumber) from T_employee
If the value connected in Concat is not a string, Oracle attempts to convert it to a string, such as executing the following SQL statement:
SELECT CONCAT (' Age: ', Fage) from T_employee
Unlike MySQL's concat () function, Oracle's CONCAT () function supports only two parameters and does not support stitching of more than two strings, such as the following SQL statement that is wrong in Oracle:
SELECT CONCAT (' Work number ', Fnumber, ' Employee name ', FName) from T_employee
WHERE FName is not NULL
After running, Oracle will report the following error message:
Invalid number of arguments
If you want to make multiple strings of stitching, you can use multiple concat () functions nested, the above SQL can be rewritten as follows:
SELECT CONCAT (CONCAT (CONCAT (' Work number ', Fnumber), ' Employee Name '), FName) from
T_employee
WHERE FName is not NULL
SQL change common query statement:
1.select Lower (Sys_guid ()) from dual; generating UUID
2.select ' INSERT into SSJ values (' | | Lower (Sys_guid ()) | | ', ' | | mmi.mmi_medical_mechanism_name| | '); ' from Js_medical_mechanism_info MMI; generating INSERT statements
Oracle Database String Connection method