functional overview
Execute SQL.
Details of Functions
Executes SQL and returns the following results
For SQL that does not return a cursor, such as INSERT/UPDATE/DELETE statements
If "Return empty dictionary" is specified for no result, an empty dictionary is returned.
If "Return numeric value" is specified for No Result, the SQLite3 error code is returned.
- note
- An example of the resulting error code returned is shown below.
result Description. 0 Successfully executed. 1 SQL execution failed. There is an error in the SQL. 2 An internal error has occurred. 19 SQL constraint violation occurred. 101 SQL executed.
For SQL that returns a cursor, such as a SELECT statement
Returns a dictionary of converted values retrieved from the database.
If a value cannot be obtained, the return value depends on the value specified in the No Result case.
If Return empty dictionary is specified, an empty dictionary is returned.
If Return Numeric is specified, the SQLite3 error code is returned.
- note
-
Fruit and Vegetable Table
ID Name Category 1 apple (fruit) fruit 2 green bell pepper vegetable 3 onion (edible plant, Allium cepa) vegetable 4 grape fruit 5 potato (Solanum tuberosum) vegetable
In the case of SQL that returns a cursor, the "dictionary to be created" is the result.
argument (e.g. function, program, programme)SQL statement SELECT Name, Category FROM produce table WHERE ID = ? parameter 2 key value Name green bell pepper Category vegetable
parameter
- argument (e.g. function, program, programme)
-
SQL statement character string data
Specifies the SQL statement to issue.parameter character string data
Specify parameter values for SQL statements. (additional argument)When there is no result the return value if the result of the SQL statement is empty or if the SQL does not return a cursor.
Specify.
- return a numerical value
- Return empty dictionary
- return value
-
character string data Dictionary (associative array) numeric data
Returns the result of an SQL statement.
If the data return value is a single column, it will be a string, but if it is multiple columns, it will be a dictionary type.
If Return number on no result is specified, the SQLite3 error code is returned when the data return value is empty, or a number representing the execution result when the SQL does not return a cursor.
If Return Empty Dictionary on No Result is specified, an empty dictionary is returned when the data return value is empty or when SQL does not return a cursor. - If the SQL syntax is invalid and a number is specified to be returned, the return value will be empty.