Comparing two different ODBC system-DNS entries. Which is faster? PS script
I haven't done a lot of PS so not sure what the error is really saying but... it looks like you are trying to fill a local table with the output from the select *? If that is true, I am wondering if PS created a temp table with a number/int column type for rownum but the rownum value in row 840 or 841 is something other than a number/int. Or something similar for another column. 

It is expecting one data type when setting up the the temp table but is finding another.

I have seen this happen more than a few times over the years of doing data etl. 

Is rownum ALWAYS in number?

What does all the data row 840 and 841 look like?

What happens if instead of select * you itemized one field? i.e. SELECT [first_ name] FROM TABLE1 WHERE ROWNUM &lt;= 900;

What if you changed the rownum? between 900 and 1800? 

BTW: cool script!