SDyke,
Is the code in op extracted from other than an SQL routine(compound SQL, SQL function, or SQL procedure, so on)?
If so, I want to recommend you
to extract the select statement from your program and execute it independently,
and see exact error code/error text of the error message(s) you received.