Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: ejonesYou cannot use a bind variable to reference a table or a column in an SQL statement. And I don't believe there are any DDL statements like the one in your example, where you can use bind variables. This is a limitation imposed by JDBC. And I'm thinking that the reasoning behind this is that the table structure in a database will be relatively stable so there would be no need for dynamic column names. (I'm not saying I agree though, I think you should be able to do exactly what I think you are attempting to do. Because there are sometimes where you might want to create generic code that works where the exact column names are not always the same. Or sometimes it could be a time saver to maybe add 40 columns to an existing table quickly using LAE)
Depending on what you need to do, you might be able to use a parameter for the column name and it might look something like this assuming that the rest of the syntax of the SQL statement is correct.
ALTER TABLE statistic ADD COLUMN {{^TheColumnName^}} Double Null
If this guess at an answer doesn't help, please provide more context about what you are doing and we might be able to help more. Maybe explain why this answer isn't working for you if it isn't.