title: Select query with dynamic column name, target table as well as dynamic where condition in i-batis
body: <p>I want to retrieve records from table 2 using Select query with dynamically returned column name, table name as well as dynamic where condition returned by table 1. I'm using sql server. Here is the following scenario -</p>
  
  <pre><code>&lt;typeAlias alias="paramBean" type="com.loyalty.sys.bulkemail.dao.ParamBean" /&gt;
  
  &lt;resultMap id="paramBeanMap" class="paramBean"&gt;
          &lt;result property="columnName" column="COLUMN_NAME" /&gt;
          &lt;result property="tableName" column="TABLE_NAME" /&gt;
          &lt;result property="uniqueKey" column="UNIQUE_KEY" /&gt;                     
  &lt;/resultMap&gt;
  
  &lt;select id="getKeywordData" parameterClass="String" resultMap="paramBeanMap"&gt;
  
      SELECT COLUMN_NAME, TABLE_NAME, UNIQUE_KEY from LT_TB_SMS_EMAIL_MESSAGE_KEYWORD where KEYWORD
      in #keywordName#
  
  &lt;/select&gt;
  
  &lt;select id="selectKeywordValue" parameterClass="paramBean" resultClass="String"&gt;
  
      SELECT #columnName# from #tableName# where #uniqueKey# in #memberNo#
  
  &lt;/select&gt;
  </code></pre>
  
  <p>I'm able to get values from first query in ParamBean properties but it is throwing error at column name in second query. I tried to search similar query but unfortunately couldn't found any where. Is it possible in i-batis or i should take another approach to retrieve records with dynamic inputs ? Any help will be appreciated. Thanks.!</p>