13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

SQL support in local databases<br />

XMLLIST<br />

Object<br />

NONE<br />

TEXT (or String)<br />

A column with TEXT or String affinity stores all data using storage classes NULL, TEXT, or BLOB. If numerical data<br />

is inserted into a column with TEXT affinity it is converted to text form before being stored.<br />

NUMERIC<br />

A column with NUMERIC affinity contains values using storage classes NULL, REAL, or INTEGER. Wh<strong>en</strong> text data<br />

is inserted into a NUMERIC column, an attempt is made to convert it to an integer or real number before it is stored.<br />

If the conversion is successful, th<strong>en</strong> the value is stored using the INTEGER or REAL storage class (for example, a value<br />

of '10.05' is converted to REAL storage class before being stored). If the conversion cannot be performed an error<br />

occurs. No attempt is made to convert a NULL value. A value that's retrieved from a NUMERIC column is returned<br />

as an instance of the most specific numeric type into which the value fits. In other words, if the value is a positive<br />

integer or 0, it's returned as a uint instance. If it’s a negative integer, it’s returned as an int instance. Finally, if it has a<br />

floating-point compon<strong>en</strong>t (it's not an integer) it's returned as a Number instance.<br />

INTEGER (or int)<br />

A column that uses INTEGER affinity behaves in the same way as a column with NUMERIC affinity, with one<br />

exception. If the value to be stored is a real value (such as a Number instance) with no floating point compon<strong>en</strong>t or if<br />

the value is a text value that can be converted to a real value with no floating point compon<strong>en</strong>t, it is converted to an<br />

integer and stored using the INTEGER storage class. If an attempt is made to store a real value with a floating point<br />

compon<strong>en</strong>t an error occurs.<br />

REAL (or Number)<br />

A column with REAL or NUMBER affinity behaves like a column with NUMERIC affinity except that it forces integer<br />

values into floating point repres<strong>en</strong>tation. A value in a REAL column is always returned from the database as a Number<br />

instance.<br />

Boolean<br />

A column with Boolean affinity stores true or false values. A Boolean column accepts a value that is an ActionScript<br />

or JavaScript Boolean instance. If code attempts to store a String value, a String with a l<strong>en</strong>gth greater than zero is<br />

considered true, and an empty String is false. If code attempts to store numeric data, any non-zero value is stored as<br />

true and 0 is stored as false. Wh<strong>en</strong> a Boolean value is retrieved using a SELECT statem<strong>en</strong>t, it is returned as a Boolean<br />

instance. Non-NULL values are stored using the INTEGER storage class (0 for false and 1 for true) and are converted<br />

to Boolean objects wh<strong>en</strong> data is retrieved.<br />

Date<br />

A column with Date affinity stores date and time values. A Date column is designed to accept values that are<br />

ActionScript or JavaScript Date instances. If an attempt is made to store a String value in a Date column, the runtime<br />

attempts to convert it to a Julian date. If the conversion fails an error occurs. If code attempts to store a Number, int, or<br />

uint value, no attempt is made to validate the data and it is assumed to be a valid Julian date value. A Date value that's<br />

retrieved using a SELECT statem<strong>en</strong>t is automatically converted to a Date instance. Date values are stored as Julian date<br />

values using the REAL storage class, so sorting and comparing operations work as you would expect them to.<br />

XML or XMLList<br />

Last updated 6/6/2012<br />

1116

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!