![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB Extensions » View Thread |
Messages 1 to 2 of 2 total |
![]() |
Wed, Jan 29 2014 3:16 PM | Permanent Link |
Barry | PosExx() Function:
============== The PosExx() is an enhancement of the built-in EDB POSITION() function. PosExx() returns the location of aSearchStr within aSourceStr but with several improvements. PosExx() will search for aSearchStr in aSourceStr in either a forward or backward direction from an offset of aStart and the search can be case-insensitive. Syntax: ======= FUNCTION PosExx(aSearchStr VARCHAR(255), aSourceStr VARCHAR(255), aStart INTEGER, -- Optional. Default = 1 aCaseInsensitive BOOLEAN) -- Optional. Default=False RETURNS INTEGER Install Instructions: ===================== 1) Copy and paste the file "PosExx.Sql" into EDBMgr's Script window. 2) Modify the 'COLLATE UNI_CI' if necessary. 3) Execute the script to create the PosExx() function. 4) Test it with the samples statements below. 5) Enjoy! select PosExx(''''ab'''',''''abdeabcABC'''')! -- returns 1 Same as POSITION() select PosExx(''''ab'''',''''abdeabcABC'''', -1)! -- returns 5. Search backwards select PosExx(''''ab'''',''''abdeabcABC'''', -1, true)! -- returns 8. Search backwards case insensitive select PosExx(''''ab'''',''''abdeabcABC'''', 3, true)! -- returns 5. Search from position 3, case insensitive select PosExx(''''ab'''',''''abdeabcABC'''', -4, true)! -- returns 6. Search backwards from -4 (''''c'''') case insensitive'' Barry Attachments: PosExx.zip |
Wed, Jan 29 2014 7:27 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() |
This web page was last updated on Wednesday, August 14, 2024 at 03:12 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |