The locate and posstr functions of DB2 first describe the usage of the two functions: locate (arg1, arg2, <pos>) to find the location where arg1 appears for the first time in arg2, specifying pos, the first position of arg1 appears at the pos of arg2. Www.2cto.com posstr (arg1, arg2) view the position of arg2 in arg1 select posstr ('mytest-100', ('test-'|. COL_VC) FROM T_TEST_ZRK A; // error select posstr ('mytest-000000', ('test-') FROM T_TEST_ZRK; // success select posstr ('mytest-100 ',. COL_VC) FROM T_TEST_ZRK A; // error select posstr (. COL_VC, '2') FROM T_TEST_ZRK A; // success select locate ('test-'|. COL_VC), 'mytest-100 '),. col_vc FROM T_TEST_ZRK A; // success select l Ocate ('good-'|. COL_VC), 'hello-'|. col_vc),. col_vc FROM T_TEST_ZRK A; // success www.2cto.com can be easily Viewed FROM the preceding statements. In posstr, arg2 can only be a fixed str and cannot be replaced by fields. arg1 can dynamically generate arg1 and arg2 In the locate.