SQLite Database Query

<< Click to Display Table of Contents >>

Navigation:  Hardware Modules > aMG SQLite Database Server > Waijung simulink block support >

SQLite Database Query

Previous pageReturn to chapter overviewNext page

User Interface

How this block appears in a Simulink model?


What can be configured?


Configuration item

Selectable option/ Value



Non-Blocking | Blocking

Blocking: CPU will wait until SQLite statement is done (Not recommended).

Non-Blocking: CPU able to process other block function during waiting for SQLite statement to complete.



INSERT: see http://www.sqlite.org/lang_insert.html

UPDATE: see http://www.sqlite.org/lang_update.html

SELECT: see http://www.sqlite.org/lang_select.html

CREATE: see http://www.sqlite.org/lang_createtable.html


Database option

Specific | Variable

Select option for database filename.

Specific: database filename is specific and cannot be changed at runtime.

Variable: database filename is variable at runtime.


(Specify database filename)

Available when Database option is select to Specific.

Table option

Specific | Variable

Select option for table name.

Specific: table name is specific and cannot be changed at runtime.

Variable: table name is variable at runtime.

Columns format

(Specify column name and type)

Valid data type is:

1. int or integer - int32

2. numeric - uint32

3. real - single

4. text - string (Volatile Data Storage block type string)


(Read only)

Preview the SQLite statement.

Enable output status

Checked | Unchecked

Checked: Output port status available, use for indicate query status.

Unchecked: Output status is not available.

Output status:

 0: SQLITE_Success

 1: SQLITE_Init

 2: SQLITE_GetPrompt

 3: SQLITE_EnterSQLitePrompt

 4: SQLITE_WaitSQLitePrompt

 5: SQLITE_WriteQueryString

 6: SQLITE_GetResult

 7: SQLITE_Finallize

 8: SQLITE_Timeout

 9: SQLITE_IO_Error

 10: SQLITE_Query_Error

 11: SQLITE_Buffer_Error  

Sample time (sec)

(Sample time)

Specify block sample time.


1. Basic UART-SQLite query demo

2. Use Waijung Blockset for SQLite data logger demo