Database[SQLite] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : Database Package : SQLite : Database/SQLite/FetchRow

Database[SQLite]

  

FetchRow

  

fetch row from prepared statement

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

FetchRow( statement, column, valuetype  )

Parameters

statement

-

prepared statement obtained using Prepare command

valuetype

-

type of the output data, default is "auto"

Description

• 

The FetchRow command returns value of all columns for the current row.

• 

In order to fetch the next row call the Step command while it return RESULT_ROW.

• 

If valuetype is a string then the type conversion it specifies applies to all columns.

• 

If valuetype is a list of strings then type of column is determined by a corresponding entry in the list.

• 

See the Database[SQLite] for more information about type conversion between SQLite and Maple.

Examples

withDatabaseSQLite

Attach,Bind,ClearBindings,Close,ColumnCount,ColumnNames,Execute,Fetch,FetchAll,FetchRow,Finalize,Open,Opened,Prepare,RESULT_BUSY,RESULT_DONE,RESULT_ROW,Reset,Step

(1)

dbFileToolsJoinPathkernelopts'datadir',SQLite,G20-Population.db:

connectionOpendb:

Select all data from table - prepare statement

stmtPrepareconnection,SELECT date, CAN FROM population LIMIT 2

stmtSQLite statement,SELECT date, CAN FROM population LIMIT 2

(2)

Stepstmt:

Fetch the first row

FetchRowstmt

1960-12-31,1.7909009107

(3)

Fetch the second row, but change the valuetype to "integer" for the first column and "text" for the second

Stepstmt:

FetchRowstmt,'valuetype'=integer,text

1961,18271000.0

(4)

Finalizestmt:

Select all data row by row

stmtPrepareconnection,SELECT date, CAN FROM population LIMIT 10

stmtSQLite statement,SELECT date, CAN FROM population LIMIT 10

(5)

whileStepstmt=RESULT_ROWdoprintFetchRowstmt,'valuetype'=integerend do

1960,17909009

1961,18271000

1962,18614000

1963,18964000

1964,19325000

1965,19678000

1966,20048000

1967,20412000

1968,20744000

1969,21028000

(6)

Finalizestmt:

Closeconnection:

Compatibility

• 

The Database[SQLite][FetchRow] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

Database[SQLite][Finalize]

Database[SQLite][Prepare]

Database[SQLite][Step]