In version 7.1.4, the TZAbstractDatabaseMetadata.FillWildcards method
created an array of one element with the symbol '%'.
In version 7.2 there are two elements: '%' and '_'.
As a result, I get an error when executing queries with table names containing the character '_'. I studied this problem and realized that it resolves if I escape the underscore in this way
Code: Select all
s: = StringReplace (ATableName, '_', '/ _', [rfReplaceAll]);
I saw a couple of similar topics on this forum, and in both cases, it was proposed to modify the FillWildcards function as a solution.
And I can do that too.
And I’ll probably do it.
But I would like to understand - why?
What is the purpose of the underscore in the Wildcards array?
If nobody needs it there, maybe you should remove it?
If it is there for some reason, then why not provide the opportunity to override this method in code?
Something like
Code: Select all
MyConnection.SetWildcards(['%'])
Code: Select all
MyConnection.UseUnderscoreInWildcards := False