Database[SQLite] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

Database[SQLite]

  

Fetch

  

fetch value of a single column

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Fetch( statement, column, valuetype  )

Parameters

statement

-

prepared statement obtained using Prepare command

column

-

index of the column

valuetype

-

type of the output data, default is "auto"

Description

• 

The Fetch command returns value of the column for the current row.

• 

The leftmost column of the result set has the index 0.

• 

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 1

stmtSQLite statement,SELECT date, CAN FROM population LIMIT 1

(2)

Stepstmt:

Fetch the first column

Fetchstmt,0

1960-12-31

(3)

Fetch the second column

Fetchstmt,1

1.7909009107

(4)

Resetstmt

Fetch both columns using all possible values for valuetype option

forvtinauto,blob,float,integer,textdoStepstmt;printvt,Fetchstmt,0,'valuetype'=vt;printvt,Fetchstmt,1,'valuetype'=vt;Resetstmtend do

auto,1960-12-31

auto,1.7909009107

blob,49575448454950455149

blob,49555748574848574648

float,1960.

float,1.7909009107

integer,1960

integer,17909009

text,1960-12-31

text,17909009.0

(5)

Finalizestmt:

Closeconnection:

Compatibility

• 

The Database[SQLite][Fetch] 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]