Month: May 2018

Sql Soundex Function

The Soundex function returns a 4-character code that represents the sound of the words in the argument. Example : Use the Soundex function to find a row where the sound of the LASTNAME value closely matches the phonetic spelling of ‘Loucesy’: Select Empno, Lastname From EmployeeTable Where Soundex(Lastname) = Soundex(‘Loucesy’); This example returns the following […]

Sql LOCATE function

The LOCATE function returns the starting position of the first occurrence of search- string within   source-string Example  : Exec Sql Select Locate(‘N’, ‘NASHVILLE’) From Sysibm/Sysdummy1; Result is 1

Get user, job name in DB2

To get the user and job name using Sql, use the following query Exec Sql Select User, Job_Name from      sysibm/Sysdummy1:

QCMDEXC no longer needs command length parm in SQL

You can use Qcmdexc procedure from Sql without the command length parameter Example : Exec Sql Call Qsys2.Qcmdexc(‘Addlible Mylib’); If you are using a variable for the command, you can use it like below: CmdString = ‘Addlible Mylib’; Exec Sql Call Qsys2.Qcmdexc(:CmdString);