Oracle SQL, PLSQL, APEX How To's by Dr. S. Raghunathan - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

 

 

should be followed some sequence number, The number should have leading zeros,

For example Receipt voucher number 1027 should be stored as RPT-001027, To achieve this we are going use two functions as combined functions, Everyone  can understand through book, the actions desired by function command  but in real time  application  environment, many time warrants combining two or more functions, In this case, we are going to use LPAD ( ), CONCAT ( ). LPAD allows you to "pad" on the left side of the column with set of characters, The characters can be spaces, periods, commas, letters, numbers, and sign, To do this, we have to give three parameters,

img6.pngstring or column-name

 

img6.pngTotal length required on result string

 

img6.pngcharacter need to be defined (to be padded characters)

LPAD (string, length, to be padded character)

 

CONCAT (string1, string2) or CONCAT (string1, column-name) or

CONCAT (column-name1, column-name2)