title: SQL query returns "value too long"
body: <p>I have a SQL query that is supposed to fill a DataTable in memory but I get an error saying "Value 'Beginning of My value' is too long."</p>
  
  <p>The query works in a SQL editor but not when I'm running it programatically with C#. Counting the value it appears do be at most about 38 characters long and at minimum 9. This isn't a lot which makes me confused as to what the issue might be? The SQL query is creating a dynamic table based off of data from other database tables with the help of subqueries. </p>
  
  <p>The error returns a number (<code>SQL0433N and SQLSTATE=22001</code>) which directs me to this <a href="https://www.ibm.com/support/knowledgecenter/en/SSEPGG_9.7.0/com.ibm.db2.luw.messages.sql.doc/doc/msql00433n.html" rel="nofollow noreferrer">explanation page.</a> </p>
  
  <p>However it does not help me directly with my problem.</p>
  
  <p>Some sample code, where <code>ImportSQLTable()</code> holds the SQL query string. </p>
  
  <pre><code> OdbcDataAdapter da = new OdbcDataAdapter(ImportSQLTable(ID), DbConnection);
   DataTable dt = new DataTable();
  
   da.Fill(dt); // Fill the table with data from the query
  </code></pre>
  
  <p>Using .NET Framework 4.6.1</p>