SQL POSSTR scalar function in DB2 for i SQL

SQL POSSTR scalar function in DB2 for i SQL
SQL POSSTR scalar function in DB2 for i SQL, sql function POSSTR in ibmi db2
SQL POSSTR scalar function in DB2 for i SQL

POSSTR

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.

Syntax of POSSTR

POSSTR(source-string, search-string)

Example using POSSTR

SELECT POSSTR( 'THIS IS TEST DATA', 'TEST')
, POSSTR('TEST DATA', 'THIS')              
 FROM sysibm.sysdummy1                     

Output:

       POSSTR          POSSTR
            9               0

Post a Comment

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