Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 3 of 3 total |
best way to find if one character exists in a stringfield value |
Tue, Feb 28 2006 1:03 PM | Permanent Link |
"Monte Etherton" | Hi Tim (and fellow elevate fans ,
I need to search for a single character value's existence in a string field called 'CharCodes'. For example, I need to know if 'K' exists in CharCodes.AsString 'GADKE'. I scan all records using: if pos('K', dm.TableName_CharCodes.AsString) > 0 then... I have an index on the CharCodes field, but don't think it's being used in this case due to the field value itself not being in any order, and the fact I am using the "pos" function. Would having the field value in order (ie 'ADEGK') help any? Is there a more efficient way to do this? Thanks for any advice, Monte |
Tue, Feb 28 2006 1:09 PM | Permanent Link |
Chris Erdal | > For example, I need to know if 'K' exists in CharCodes.AsString
> 'GADKE'. If you want to limit the number of rows returned by a Query to optimise this, you could do a SELECT ... FROM ... WHERE CharCodes LIKE '%K%' and then every row has one! -- Chris |
Tue, Feb 28 2006 2:12 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Monte
It sounds like you're using the OnFilter event, if so I suggest you switch to using a filter. DBISAM is brilliant in that the filters are almost identical to sql. So you could set a filter along the lines of CharCodes LIKE '%K%' (nicked from Chris's post). Roy Lambert |
This web page was last updated on Wednesday, April 24, 2024 at 11:07 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |