limelect
Members-
Content Count
775 -
Joined
-
Last visited
-
Days Won
1
Everything posted by limelect
-
@Lars Fosdal If I used the logic on SQL I had a memory problem I used the table to filter with the OR logic. For example I got 3 records out of 750. Using these records I did the SQL with SectionsId=FilesIndex' and this did it. For the time being. It seems that using tables (if you can) is better at least in my case.
-
First thanks to everybody. Especially @Lars Fosdal as I used his solution (INSTR) my main problem was SQL memory problems. I hope I fixed most of it. Now to my specific solution DataSource1.DataSet := ProjectsFDTable; RESET Grid. FDLocalSQL1.DataSets.Clear; FDQuery4.Close; FDQuery4.SQL.Clear; FilesFDTable.Filtered:=False; FilesFDTable.Filter:= '(MainDirectory LIKE ''%' + JvDirectoryEdit1.Text + '%'') OR INSTR(''' + JvDirectoryEdit1.Text + ''', MainDirectory) > 0' ; FilesFDTable.Filtered:=True; FDLocalSQL1.DataSets.Add(FilesFDTable); FDLocalSQL1.Active := True; ProjectsFDTable.LocalSQL:=FDLocalSQL1; << otherwise I had problems FDQuery4.SQL.add('Select SectionsId,MainDirectory,MyDateTime,ProjectName,ProjectrealName,Category,FileMask ,Description,FilesIndex'); FDQuery4.SQL.add('from FilesFDTable,Projects'); FDQuery4.SQL.add(' WHERE SectionsId=FilesIndex'); FDQuery4.Open;<< use Query on the grid DataSource1.DataSet := FDQuery4; 1. I added LocalSQL to my ProjectsFDTable; 2. I filter my file table. (NO memory problem) as per @Lars Fosdal suggestion with OR 3. I added to my LocalSQL FDLocalSQL1.DataSets.Add(FilesFDTable); after filtering 4. I query FDQuery4.SQL.add('from FilesFDTable,Projects'); Now no memory problems OR until the next problem on a large software. And thanks again
-
@haentschman can you plz try on my demo? the zip is in this communication. Otherwise, I am too tired of trying solutions. 1 solution too many
-
@haentschman put it in my demo and checked it in 3 lines to change that it
-
@haentschman why don't you guys try this on my demo?? does not work FDQuery1.SQL.Text := 'select * from Files where MainDirectory LIKE :Code'; FDQuery1.ParamByName('code').AsString := '%G:\Delphi Projects\DelphiArea\DelphiComponenets\simplegraphxx%'; FDQuery1.Open; PLZ stop guessing
-
@haentschman I do not see how it applies to my case furthermore doing too much with SQL in my a[pplication have a lot of memory problems. My solution, for the time being, is to split LIKE and Lars Fosdal sugestion INSTR I could not use the statement FDQuery1.SQL.add('WHERE (MainDirectory LIKE ''%' + Edit1.Text + '%'') OR INSTR(''' + Edit1.Text + ''', MainDirectory) > 0' ); As it gives me memory problems.
-
Error I put a zip test do not guess
-
@tgbs There is a test source (zip)very simple to change in the source did you try it?
-
For the time being, I will give the user a choice like or INSTR which will solve my memory problem. Until I will come up with a different coise
-
no, since it gives me other problems.
-
@Attila Kovacs Well thanks but you still use not nice words. P.S did you start with D1 like me? And much much before.
-
Well, it returns me to my original problem OUT OF MEMORY. I made a crazy software. In any case, you helped a lot.Thanks
-
@Lars Fosdal BIG BIG THANKS FDQuery1.SQL.add('WHERE (MainDirectory LIKE ''%' + Edit1.Text + '%'') OR INSTR(''' + Edit1.Text + ''', MainDirectory) > 0' ); I will check it on the real software
-
Delete some chare and it WII NOT find part of the text The Like finds if you delete some char INTR find if you add char maybe i will try to OR both
-
Maybe I will clarify my problem I add the base directory to the database. But this directory has many subdirectories and if one searches for a subdirectory he still needs to find the main directory. This is why my search is like that. Do you think there is another way to solve the problem?
-
yes just add a few characters to the text and it will not find the item (a record) and this is what I want or delete some text and it will find see my first writings WITHIN my DB text
-
@Lars Fosdal OK I put a very simple 1 line database with "like" statement So check it out. Add or delete text and see for yourself Compiled with D10.2.3 with source TestLike.zip
-
@Attila Kovacs It is not a nice response. You do not know my application and my professional reasoning.
-
@Attila Kovacs Reasons for my application
-
@Lars Fosdal Unfortunately all those 'like' explanations are known to me Or would you like me to make a small DB source to examine the problem? and put it here?
-
@Lars Fosdal I invite you to enter my computer and see for yourself with our private communication
-
@Lars Fosdal this F7 full statement output that works 'Select SectionsId,MainDirectory,MyDateTime,ProjectName,ProjectrealName,Category,FileMask ,Description,FilesIndex'#$D#$A'from Files,Projects'#$D#$A'WHERE MainDirectory LIKE ''%G:\Delphi Projects\image32_3.2.2%''AND SectionsId=FilesIndex' As you see no problem
-
@Lars Fosdal NO escape but i see there are 2 more possibilities SUBSTRING and containing from containing does not work unless i do not know how to use it
-
As i can see there is a 'SUBSTRING' so how to use it?