Archive | SQL RSS feed for this section

Working with dates in Flex AIR and SQLite

UPDATE 3/25/09: Paul Robertson from the AIR team stopped by and writes that declaring your SQLite column affinity (ie column type) as “DATE” will instruct AIR to handle all date conversions for you automatically.  The problems I experienced mainly surfaced in a DataGrid when using a DateField and I have not had a chance to [...]

29 Comments Continue Reading →

Ridiculous date formatting in SQLite

The following code outputs a SQLite date into a standard date format with month abbreviations that, believe it or not, Flex/AIR will accept as a Date value (Though SQLite itself doesn’t recognize it as a valid DATETIME!). I created this atrocious code while trying to figure out the mysterious interaction between AIR and SQLite date [...]

Leave a comment Continue Reading →

Subtracting unsigned integers with MySQL

Unsigned integer values are used in a database when you only expect to contain positive values and no negative values (less than zero). If you know a certain field will never legitimately contain negative values, then this is actually the most efficient field type to select. There is a catch with unsigned ints however that [...]

5 Comments Continue Reading →

Beyond auto-id: Advanced Sequential Numbering with MySQL

MySQL auto-id function provides the ability to automatically create a new id for each new record on insert. This works great for unique ids, but sometimes more logic is required. For a recent assignment we needed to populate a table that reflects seating in a stadium. The seating was typical of most venues consisting of [...]

7 Comments Continue Reading →

MySQL Error Number 1005 Can’t create table ‘.\mydb\#sql-328_45.frm’ (errno: 150)

MySQL Error Number 1005 Can’t create table ‘.\mydb\#sql-328_45.frm’ (errno: 150) If you get this error while trying to create a foreign key, it can be pretty frustrating. The error about not being able to create a .frm file seems like it would be some kind of OS file permission error or something but this is [...]

194 Comments Continue Reading →