WCTStatement Class Reference

Inherits from WCTCore : NSObject
Declared in WCTStatement.h

Overview

Not Thread-safe

This class is a wrapper for sqlite3_stmt.

Other Methods

– getError

More detailed error messages.

- (WCTError *)getError

Return Value

nil or error.isOK==YES if no error occurs.

Declared In

WCTStatement.h

– bindValue:toIndex:

The wrapper of sqlite3_bind_*.

- (BOOL)bindValue:(WCTValue *)value toIndex:(int)index

Parameters

value

The WCTValue can be NSString, NSNumber, NSData, NSNull and nil.

index

Begin with 1.

Return Value

NO only if you pass a incorrect type of value.

Declared In

WCTStatement.h

– bindValue:byColumnName:

The wrapper of sqlite3_bind_*.

- (BOOL)bindValue:(WCTValue *)value byColumnName:(NSString *)columnName

Parameters

value

The WCTValue can be NSString, NSNumber, NSData, NSNull and nil.

columnName

columnName.

Return Value

NO only if you pass a incorrect type of value.

Declared In

WCTStatement.h

– getValueAtIndex:

The wrapper of sqlite3_column_*.

- (WCTValue *)getValueAtIndex:(int)index

Parameters

index

Begin with 0.

Return Value

The real type of WCTValue depends on the value in database.

Declared In

WCTStatement.h

– getValueByColumnName:

The wrapper of sqlite3_column_*.

- (WCTValue *)getValueByColumnName:(NSString *)columnName

Parameters

columnName

columnName.

Return Value

The real type of WCTValue depends on the value in database.

Declared In

WCTStatement.h

– step

The wrapper of sqlite3_step.

- (BOOL)step

Return Value

YES means you can continue stepping. NO means the stepping has been completed or an error occurs.

Declared In

WCTStatement.h

– reset

The wrapper of sqlite3_reset.

- (void)reset

Declared In

WCTStatement.h

– getTypeAtIndex:

The wrapper of sqlite3_column_type.

- (WCTColumnType)getTypeAtIndex:(int)index

Parameters

index

Begin with 0.

Return Value

Column type.

Declared In

WCTStatement.h

– getTypeByColumnName:

The wrapper of sqlite3_column_type.

- (WCTColumnType)getTypeByColumnName:(NSString *)columnName

Parameters

columnName

columnName.

Return Value

Column type.

Declared In

WCTStatement.h

– getColumnCount

The wrapper of sqlite3_column_count.

- (int)getColumnCount

Return Value

Count of column result.

Declared In

WCTStatement.h

– getColumnNameAtIndex:

The wrapper of sqlite3_column_name.

- (NSString *)getColumnNameAtIndex:(int)index

Parameters

index

Begin with 0.

Return Value

The description of column result.

Declared In

WCTStatement.h

– getIndexByColumnName:

Get index by column name.

- (int)getIndexByColumnName:(NSString *)columnName

Parameters

columnName

columnName.

Return Value

The index of given column name. INT_MAX will be returned if no such column name.

Declared In

WCTStatement.h

– getTableNameAtIndex:

The wrapper of sqlite3_column_table_name.

- (NSString *)getTableNameAtIndex:(int)index

Parameters

index

Begin with 0

Return Value

The name of table

Declared In

WCTStatement.h

– finalize

The wrapper of [sqlite3_finalize].

- (void)finalize

Declared In

WCTStatement.h

Compatible Methods

– getCount

The wrapper of sqlite3_column_count.

- (int)getCount

Return Value

Count of column result.

Declared In

WCTStatement+Compatible.h

– getNameAtIndex:

The wrapper of sqlite3_column_name. Use -getColumNameAtIndex: instead.

- (NSString *)getNameAtIndex:(int)index

Parameters

index

Begin with 0.

Return Value

The description of column result.

Declared In

WCTStatement+Compatible.h

– resetBinding

The wrapper of sqlite3_reset.

- (void)resetBinding

Declared In

WCTStatement+Compatible.h