Michael Peppler <[EMAIL PROTECTED]> wrote: >>I think it would be a good idea for do() to do nothing when >>given an empty string, so that the behaviour is consistent >>across backends.
>I realize that you are speaking in general terms - but DBD::Sybase >implements its own version of do() in order to handle multiple result >sets, etc. In that case, since it is Sybase that seems to have an unnatural objection to the empty string, DBD::Sybase should cover up this deficiency and just do nothing when given an empty statement. >I agree that the zero-length string as argument to do() >should maybe be flagged as an error, That isn't really my feeling; I think that it would be better to treat '' as the statement that does nothing, and save a trip to the database. But warning about it at the Perl level would be better than waiting for Sybase to give an error, in the particular case of DBD::Sybase. >I'm guessing that you ran into this in some code that builds a SQL >statement in a perl variable and then submits it to the server via do() >- and ended up submitting an empty string... Yes. But I didn't think that was a bug in the SQL-building code. It decided nothing needed to be done, and generated some SQL to do just that. It would be good if such SQL could be handled correctly. In the meantime I have changed my code to always generate at least one space character for the query, since Sybase doesn't object to that. -- Ed Avis <[EMAIL PROTECTED]>