Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

mozIStorageStatementParams

This interface has no defined properties, but has properties based on the named parameters found in the SQL from the statement it was accessed off of.  For example, say you create a statement like so:

var statement = dbConn.createStatement("SELECT * FROM table_name WHERE id = :item_id");

This object would have one property, item_id, that you can use to bind a value to that named parameter like so:

statement.params.item_id = 2;

For more details on why you should bind parameters as opposed to hard-coding them into your statement, please see the overview document about binding parameters.

Enumeration of properties

You can also enumerate all the properties on this object with a for..in enumeration:

// valuesToBind is an object that contains key-value pairs
// to bind to the statement before executing it.
for (let param in statement.params)
  statement.params[param] = valuesToBind[param];

See also

Document Tags and Contributors

 Contributors to this page: teoli, Sheppy, sdwilsh, Arehman4
 Last updated by: Sheppy,