in reply to EOF required before writing DB?

strat is right - when you query a SQL database the order in which rows are returned is undefined, unless you specify an ORDER BY clause.

Some database engines will return rows in a predictable order without an ORDER BY clause (for example, Sybase returns rows in the order of the clustered index, if it exists), but this is general a side effect of the underlying data storage, and shouldn't be relied on.

HTH.

Michael

Replies are listed 'Best First'.
Re: Re: EOF required before writing DB?
by sdyates (Scribe) on Mar 06, 2002 at 18:36 UTC
    Appreciate the input guys. So it is no bad form to have records not written by appending to the end of the table?

    I will impliment the order by clause. I was under the impression that I was not doing things correctly. I rather learn the correct way of doing things.

    Regards,

    Simon

      I looked into this a little further. Calling

      $dbh->disconnect

      closes the database connection. I am calling this script at the end of each SQL command. All seems to be working well so far. The ...ORDER BY was also handy and I should have thought of this before. See what happens when one does not use perl everyday...