I'm having a problem that I can't figure out. The situation is as follows: I have a procedure that I call by passing a string, which is basically the name of a table. In this particular case it is "sys_configuration".
That procedure basically executes the following lines:
Query.Close();
Query.ParamByName('TABLA').AsString := Tabla;
Query.Open;
"Query" basically has this:
SELECT * FROM :TABLA;
So you should run the following:
SELECT * FROM sys_configuracion;
TRUE?
Well, apparently I'm having an error. Since when testing it and executing my procedure this happens:
[FireDAC][Phys][SQLite] ERROR: near ":TABLA:" syntax error.
Does SQLite work differently with parameters? I can't find why it fails.
The problem is that no parameters can be used anywhere in the SQL statement. For example, you cannot define SQL like this:
And define the parameter as
'SELECT'
. Even if the statement is correct, it will return an error.The same goes for the one you are defining. At least in other engines it is like that and I imagine that it is the same in SQLite. In this case, I think that you only have to define the query by concatenating strings and without using that parameter.