Berger, Daniel wrote: > Hi all, > > Ruby 1.6.8 > ruby-dbi 0.18 > oracle 0.2.11 (ruby driver) > Oracle 8.1.5 (oracle) > Solaris 9 > > I've noticed a parsing problem with leading sql comments and sql that ends > with a placeholder. For example, > > --random comment > select column1, column2 > from table1 > where somevalue > ? > > In both ruby and TORA, this causes oracle error 24374: "define not done > before fetch or execute and fetch". However, I do not get this error via > sqlplus or TOAD, so I'm fairly certain it's not an Oracle client side issue. > It appears to be some sort of sql parsing problem. > > Interestingly, changing the "?" to a fixed value fixes the parsing error in > ruby-dbi, although TORA still chokes. > > Is this an oracle driver problem or a ruby-dbi problem? And can it be fixed > (please)? It should be simple to fix. All we have to do is to split the SQL statement into lines (separated by \n), then sort those out starting with --, and finally join it again to proceed with the usual tokenizing steps. I'll put this into 0.0.19. Are there problems with "--" comments for other databases than Oracle? Or should I only process comments for the Oracle-DBD? Regards, Michael > > Regards, > > Dan > -- Michael Neumann *** eMail uu9r / rz.uni-karlsruhe.de