Functions are an important concept in DB2. Look for job requirement for data warehousing jobs. If we want to make a report from the data, we use built-in functions to get required output. It simplifies your SQL query.
There are many examples. I am giving my own examples.
“RAMA RAGAVA RANI “
SELECT RTRIM(“RAMA RAGAVA RANI “) FROM SYSIBM.SYSDUMM1 …> You will get result “RAMA RAGAVA RANI “. Means it removes space on right side.
” RAMA RAGAVA RANI “
SELECT LTRIM(” RAMA RAGAVA RANI”) FROM SYSIBM.SYSDUMM1 …> You will get result “RAMA RAGAVA RANI “. Means it removes space on left side.
” RAMA RAGAVA RANI “
SELECT TRIM(” RAMA RAGAVA RANI “) FROM SYSIBM.SYSDUMM1 …> You will get result “RAMA RAGAVA RANI “. Means it removes space on both sides.
The above are beautiful examples. You can use extensively. Refer more built in functions here.
References
- SQL DBA for beginners
- PL/SQL video training for all developers
- Advanced SQL training for senior developers
Related Posts







3 responses
[…] I hope you enjoyed my previous post on some built-in functions. […]
LikeLike
[…] already enjoyed with my earlier post on built-in functions. LOCATE is a Scalar function. Syntax for LOCATE function is as […]
LikeLike
[…] but not to say as it is NULL. The answer to this question you need to tell very nicely. The other functions in DB2 you can read before you move […]
LikeLike