FreeMat: vtkSQLiteQuery

FreeMat

- Main Page
- Related Pages

vtkSQLiteQuery

Section: Visualization Toolkit IO Classes

# Usage

This is an implementation of vtkSQLQuery for SQLite databases. See the documentation for vtkSQLQuery for information about what the methods do.

.SECTION Bugs

Sometimes Execute() will return false (meaning an error) but GetLastErrorText() winds up null. I am not certain why this is happening.

.SECTION Thanks Thanks to Andrew Wilson from Sandia National Laboratories for implementing this class.

To create an instance of class vtkSQLiteQuery, simply invoke its constructor as follows

      obj = vtkSQLiteQuery

# Methods

The class vtkSQLiteQuery has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkSQLiteQuery class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkSQLiteQuery = obj.NewInstance ()`
- `vtkSQLiteQuery = obj.SafeDownCast (vtkObject o)`
- `bool = obj.SetQuery (string query)` - Set the SQL query string. This must be performed before Execute() or BindParameter() can be called.
- `bool = obj.Execute ()` - Execute the query. This must be performed before any field name or data access functions are used.
- `int = obj.GetNumberOfFields ()` - The number of fields in the query result.
- `string = obj.GetFieldName (int i)` - Return the name of the specified query field.
- `int = obj.GetFieldType (int i)` - Return the type of the field, using the constants defined in vtkType.h.
- `bool = obj.NextRow ()` - Advance row, return false if past end.
- `bool = obj.HasError ()` - Return true if there is an error on the current query.
- `bool = obj.BeginTransaction ()` - Begin, abort (roll back), or commit a transaction.
- `bool = obj.RollbackTransaction ()` - Begin, abort (roll back), or commit a transaction.
- `bool = obj.CommitTransaction ()` - Begin, abort (roll back), or commit a transaction.
- `string = obj.GetLastErrorText ()` - Get the last error text from the query
- `bool = obj.BindParameter (int index, int value)` - The following methods bind a parameter value to a placeholder in the SQL string. See the documentation for vtkSQLQuery for further explanation. The driver makes internal copies of string and BLOB parameters so you don't need to worry about keeping them in scope until the query finishes executing.
- `bool = obj.BindParameter (int index, float value)` - The following methods bind a parameter value to a placeholder in the SQL string. See the documentation for vtkSQLQuery for further explanation. The driver makes internal copies of string and BLOB parameters so you don't need to worry about keeping them in scope until the query finishes executing.
- `bool = obj.BindParameter (int index, double value)` - The following methods bind a parameter value to a placeholder in the SQL string. See the documentation for vtkSQLQuery for further explanation. The driver makes internal copies of string and BLOB parameters so you don't need to worry about keeping them in scope until the query finishes executing.
- `bool = obj.BindParameter (int index, string stringValue)` - Bind a string value – string must be null-terminated
- `bool = obj.ClearParameterBindings ()` - Bind a blob value. Not all databases support blobs as a data type. Check vtkSQLDatabase::IsSupported(VTK_SQL_FEATURE_BLOB) to make sure.