It's not a workaround, that's how relational databases work. You're thinking of a flat file, where you append to the end of the file; a relational table is usually a B-tree of disk pages, even when it's stored in a single disk file. There's no notion of "order" in a table, only a notion of "order" in the result set that you retrieve.

That said, some databases support ordering in a clustered index, so you can predict (mostly) where the next write will go. I don't know if MySQL supports that.

But the question just begs to be asked: why do you even care where the row is? One of the big wins of RDBMS is that you don't have to care; the underlying database manages the space for you. All you really care about is how it looks when it gets to you, and the order by is meant to give you that.


In reply to Re (3) EOF required before writing DB? by VSarkiss
in thread EOF required before writing DB? by sdyates

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.