Sorry, it was only my mistake in copying wrong parts of testing code.
I tested it using exactly the same query and both cases (selecting either one or all columns with *). In both cases I got the same result. PDO passes, DAO not.
Oracle (not tested on other RDBMS) doesn’t seems to be liking “WHERE rowid < 1000” part. When this one is removed, execution of query using both PDO and DAO passes.
Unfortunately, not! And to be honest, I would be surprised, if this would change anything. IMHO if something works in PDO but not in DAO then this is DAO-related problem, lying somewhere in core code, not SQL-related one.
Tried both:
$sql = "SELECT * FROM WWW_USERS WHERE 'ROWID' < 300";
and:
$sql = 'SELECT * FROM WWW_USERS WHERE "ROWID" < 300';
No luck. The only difference is that with first notation I got different error. This time this is "1722 OCIStmtExecute: ORA-01722: incorrect number", while in second case I got the same errro (932) as written in first post in this topic.
It is also worth noting, that all three options (without quoting ROWID and with quoting it both with single and double quotes) works fine in PDF.
Both solutions proposed by you did not work. But I did a bit deeper research and found out that the problem relates to PDO not DAO. After pasting the very same SQL statement to Oracle SQL Developer I got the same error. I also checked what PDO is actually returning and found out that nothing. This assured me that SQL itself is wrong, and PDO is somehow hiding this error, while DAO is showing it.
ROWID in Oracle seems to be an object and you can’t limit number of records this way. Instead you have to use ROWNUM:
$sql = 'SELECT * FROM WWW_USERS WHERE ROWNUM < 50';
I found this Oracle article about querying Oracle DBs with using ROWID. You might want to read it, if you plan to add similar function to Oracle class in Yii.
Now, it seems that not. PDO is hiding errors like this one, while DAO shows them. A small stupidity of PDO in favor to DAO.
No, I’m talking about ROWID pseudocolumn of Oracle. Just like I explained in above post. It returns letters but seems to be an object. After all, it was my mistake that I used ROWID where I should use ROWNUM, but thanks to this I discovered an issue that PDO is hiding error in such situations. Thanks for Googling for me.