title: DB2 error Improper use of a string column, host variable, constant, or function
body: <p>I'm trying to search all tables and columns for a certain value and I'm using php connection to IBM DB2 database. I was wondering if the error is cause because of multiple usage of union.</p>
  
  <p>This is my error message :</p>
  
  <pre><code>Improper use of a string column, host variable, constant, or function "NAMABARANG". SQLSTATE=42907 SQLCODE=-134
  </code></pre>
  
  <p>And here is my code : </p>
  
  <pre><code>$keyword=$_GET['keyword'];
  $query="SELECT * FROM INVENTORY WHERE NAMABARANG LIKE '%".$keyword."%'".
      " UNION ALL SELECT * FROM INVENTORY WHERE ARRIVALDATE LIKE '%".$keyword."%'".
       " UNION ALL SELECT * FROM INVENTORY WHERE PAPERNUMBER LIKE '%".$keyword."%'".
       " UNION ALL SELECT * FROM INVENTORY WHERE SERIALNUMBER LIKE '%".$keyword."%'".
       " UNION SELECT * FROM INVENTORY WHERE CONDITION LIKE '%".$keyword."%'".
       " UNION ALL SELECT * FROM INVENTORY WHERE LOCATION LIKE '%".$keyword."%'".
       " UNION ALL SELECT * FROM INVENTORY WHERE CONFIRMATIONDATE LIKE '%".$keyword."%'".
       " UNION ALL SELECT * FROM INVENTORY WHERE BARCODE LIKE '%".$keyword."%'".
       " UNION ALL SELECT * FROM USERANDPASSWORD WHERE USERNAME LIKE '%".$keyword."%'";
       " UNION ALL SELECT * FROM USERANDPASSWORD WHERE ACCESS LIKE '%".$keyword."%'";
  </code></pre>