3

I was executing a simple sql query ="

select id, first_name, last_name, city
from customer where id = :id

and using namedParamterJdbcTemplate to execute this query.

Now I want to make the table name also variable like this

select id, first_name, last_name, city
from :customer
where id = :id

I will Pass the table name and id using HashMap. But I am getting error stating invalid sql statement?

1
  • 2
    SQL does not allow you to pass in identifiers as parameters. Identifiers include table names, column names, functions, database names, schema names, and operators. Commented Jun 9, 2018 at 12:27

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.