title: SQLBindParameter to prepare for SQLPutData using C++ and SQL Native Client
body: <p>I'm trying to use <code>SQLBindParameter</code> to prepare my driver for input via <code>SQLPutData</code>.  The field in the database is a <code>TEXT</code> field. My function is crafted based on MS's example here:
  <a href="http://msdn.microsoft.com/en-us/library/ms713824(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms713824(VS.85).aspx</a>.</p>
  
  <p>I've setup the environment, made the connection, and prepared my statement successfully but when I call <code>SQLBindParam</code> (using code below) it consistently fails reporting: <code>[Microsoft][SQL Native Client]Invalid precision value</code></p>
  
  <pre><code>int col_num = 1;
  SQLINTEGER length = very_long_string.length( );
  retcode = SQLBindParameter( StatementHandle,
              col_num,
              SQL_PARAM_INPUT,
              SQL_C_BINARY,
              SQL_LONGVARBINARY,
              NULL,
              NULL,            
              (SQLPOINTER) col_num,     
              NULL,                 
              &amp;length ); 
  </code></pre>
  
  <p>The above relies on the driver in use returning "N" for the <code>SQL_NEED_LONG_DATA_LEN</code> information type in <code>SQLGetInfo</code>.  My driver returns "Y".  How do I bind so that I can use <code>SQLPutData</code>?</p>