SQL POSITION scalar function in DB2 for i SQL

SQL POSITION scalar function in DB2 for i SQL
SQL POSITION scalar function in DB2 for i SQL, sql function position in ibmi db2
SQL POSITION scalar function in DB2 for i SQL

POSITION

The POSITION function returns the position of the first occurrence of the search string in the source string. If the search string is not found in the source string, then the result is 0.

Example

SELECT POSITION('TEST DATA', 'THIS is TEST DATA')
, POSITION('TEST DATA', 'THIS is TEST')          
 FROM sysibm.sysdummy1                           

Output:

POSITION function  POSITION function
              9                  0  

Post a Comment

© AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain