But be careful how you deliver data to a queryString parameter, as such parameters re-open the SQL Injection security hole if given user-supplied data. That is, don't permit user-supplied data. If it will come from a user selection, use an index key in the UI, and perform a lookup to get the correct string at the point of the query. (The lookup would contain the valid possibilities.)
The "more susceptible to SQL Injection" verbiage is just fluff. Either the technique is susceptible or it is not. Query strings are susceptible, themselves, and must be guarded. Value parameters are not susceptible to SQL Injection. That's the point.
Named query is working without putting the '' on querystring. If I put like '{tablename 2}'. It is throwing error.
In report, neither working on puttingg '' nor with quotes for querystring in named query.
What brand of database is this? Certain brands don't accept SQL standard identifier quotes unless set to standards-compliant mode. (ANSI mode in SQL Server.)