Dashboard > iBATIS DataMapper > Home > Frequently Asked Questions > Pass in a dynamic table name - or other uncommon parameters
Pass in a dynamic table name - or other uncommon parameters
Added by Brice Ruth, last edited by Brice Ruth on Jun 28, 2005
Labels: 
(None)


It is quite easy to use a parameter as a table name or in any other portion of a SQL statement, e.g. IN ( ... ) syntax.

Instead of using the ## denotation, use $$. For example:

SELECT * FROM $myValue$ WHERE AGE=#myAge#

Be sure to indicate 'remapResults="true"' in your definition. Using the $$ syntax instead of ## modifies the actual SQL statement, before parameters are applied.

NOTE: The $$ syntax should be used with caution because of it's obvious potential for SQL injection attacks.


Site running on a free Atlassian Confluence Open Source Project License granted to OSS. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators