Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB Extensions » View Thread |
Messages 1 to 2 of 2 total |
PosExx() Function enchances Position() for searching strings |
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. timyoung@elevatesoft.com |
This web page was last updated on Thursday, March 28, 2024 at 08:36 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |