Good day, I have a problem with a query generated by a Pascal procedure. The query is as follows:
Select CodigoProveedor as Codigo
From proveedores
where Activo = 1
And CodigoProvedores not in (....aca hay muchos strings)
--y a su vez hay muchos NOT IN por una cuestion de lectura
And it throws me the following error:
I think that the engine expected a space or a ;, given the length of the query and that is why it throws me the error, but I really have no idea. If you can give me a hand I would appreciate it.
What there is a limit to is the size of an SQL statement, this firebird FAQ says:
My free translation is (emphasis mine):
IBExpert (which is made in Delphi) is likely passing the statement in UTF16, so that would reduce the limit to just 32767 characters.
A possible alternative, given what you want to do, is that you have a temporary table in which you deposit all the data from the not in and rewrite your query to pull from said table:
Go inserting in this table the records to exclude:
Finally: