Subject | Re: [IBO] Full Text Search Results directly into table |
---|---|
Author | robert.gilland |
Post date | 2009-08-11T01:53:19Z |
After substantial amounts of Trial and Error.
I have come up with the solution ans it works.
if not ConnectDB then
exit;
ftsSearch.SearchIndexName := ftsIndexNames[ftsI];
ftsSearch.ResetVariables;
ftsSearch.SetSearchWordsString(SearchFor,tstWordPartial);
qrySearch.KeyRelation := ftsTableNames[ftsI];
qrySearch.KeyLinks.Text := ftsKeyColumns[ftsI];
with qrySearch.SQL do
begin
clear;
add('INSERT INTO FILTERSTD');
add('( FILTERID, CODE1 )');
add('SELECT DISTINCT ' + IntToStr(FilterID));
add(',CAST(' + ftsKeyColumns[ftsI] + ' AS VARCHAR(14))');
add('FROM ' + ftsTableNames[ftsI] );
end;
qrySearch.Execute;
DisConnectDB;
Kind Regards,
Robert.
I have come up with the solution ans it works.
if not ConnectDB then
exit;
ftsSearch.SearchIndexName := ftsIndexNames[ftsI];
ftsSearch.ResetVariables;
ftsSearch.SetSearchWordsString(SearchFor,tstWordPartial);
qrySearch.KeyRelation := ftsTableNames[ftsI];
qrySearch.KeyLinks.Text := ftsKeyColumns[ftsI];
with qrySearch.SQL do
begin
clear;
add('INSERT INTO FILTERSTD');
add('( FILTERID, CODE1 )');
add('SELECT DISTINCT ' + IntToStr(FilterID));
add(',CAST(' + ftsKeyColumns[ftsI] + ' AS VARCHAR(14))');
add('FROM ' + ftsTableNames[ftsI] );
end;
qrySearch.Execute;
DisConnectDB;
Kind Regards,
Robert.