-
Notifications
You must be signed in to change notification settings - Fork 1
/
subs-functions.txt
39 lines (27 loc) · 1.22 KB
/
subs-functions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'--- open a sqlite DB
SUB DB_Open (dbName AS STRING, CreateIfMissing AS _BYTE)
FUNCTION DB_Open%% (dbName AS STRING, CreateIfMissing AS _BYTE)
'--- close a database
SUB DB_Close ()
'--- return primary key of last inserted record
FUNCTION DB_LastInsertedRowID& ()
'--- return number of rows the last query affected
FUNCTION DB_AffectedRows& ()
'--- return the last error message (if any)
FUNCTION DB_GetErrMsg$ ()
'--- return total of rows in a recordset
FUNCTION DB_RowCount& (RS() AS SQLITE_RESULTSET)
'--- return number of columns in a recordset
FUNCTION DB_ColCount& (RS() AS SQLITE_RESULTSET)
'--- Gets the value of a field
FUNCTION DB_GetField$ (RS() AS SQLITE_RESULTSET, Row AS LONG, FieldName AS STRING)
'--- Use for Scalar functions, returning 1 value
FUNCTION DB_ExecQuerySingleResult$ (sql_command AS STRING)
'--- Execute a SQL query and return a recordset
SUB DB_ExecQuery (sql_command AS STRING, RS() AS SQLITE_RESULTSET)
FUNCTION DB_ExecQuery& (sql_command AS STRING, RS() AS SQLITE_RESULTSET)
'--- Execute a SQL query with no return value
SUB DB_ExecNonQuery (sql_command AS STRING)
FUNCTION DB_ExecNonQuery& (sql_command AS STRING)
'--- Helper function to build SQL statements
FUNCTION DB_SqlParse$ (sql_str$, values_str$)