1. SQL Conversion Functions
By: Ms. Rubab
Rubab.itc@suk-iba.edu.pk
IBA ITC Sobhodero
Managed By Khairpur Campus,
IBA Sukkur University
By: Ms. Rubab For DIT
3. Implicit Data Conversion
Implicit Data-Type Conversion :
In this type of conversion the data is converted from one type to
another implicitly (by itself/automatically).
Example: from varchar to number
Varchar Number
By: Ms. Rubab For DIT
4. Example of Implicit conversion
Query 1: Query 2:
SELECT Fees FROM `students` WHERE fees>2000
‘Here 2000 is in number form’
Query 2:
SELECT Fees FROM `students` WHERE fees>'2000’
‘Here 2000 is in text/string form’
The output of both queries will be same because
SQL automatically converts the text to number
By: Ms. Rubab For DIT
6. Explicit Conversion
TO_CHAR Function :
TO_CHAR function is used to typecast a numeric or date input to
character type with a format model (optional).
SYNTAX :
TO_CHAR(number1, [format], [nls_parameter])
By: Ms. Rubab For DIT