Showing entries 1 to 2
Displaying posts with tag: sequence (reset)
Numbers, Numbers Everywhere

Why You Care About Numbers

I have worked a bit with Oracle. As such, I hang out around Oracle developers. There seems to be a common complaint among our kind when it comes to MySQL–”There aren’t any sequences!”

It never really bothered me. I wasn’t always an Oracle guy, so I didn’t always have sequences. I’m the kind of person who likes to experiment and make things happen. It just so happens there is a nice tool to help with this perceived absence: the “numbers table.”

It is really easy to set up. And, regardless of your database background, I think you will grow to love your utility.

There are multiple ways to achieve the result you want. For me, the easiest way is to work with decimal numbers. Why? Because that’s how we think. That’s pretty much standard for humans. Yeah, I know. Geeks think hexadecimal. Let’s not go there.

Without further ado, here is how you can create …

[Read more]
MariaDB’s Sequence Storage Engine

Versione italiana

MariaDB 10.0.3 introduces a new Storage Engine: Sequence. It isn’t in MySQL or in older MariaDBs versions. Sequence is a special engine, which does not create or read any table. It only generates on the fly a sequence of integers which is returned to your query, and then dies. The sequence’s bounds and increment depend from the table name.

Very quick start

To install:

INSTALL PLUGIN sequence SONAME 'ha_sequence';

NOTE: On MariaDB (unlike Oracle MySQL) there is no need to add ‘.dll’ to the command on Windows, so the command is platform-independent. Thanks Vladislav Vaintroub for this information!

To …

[Read more]
Showing entries 1 to 2