Code: Select all
TaskManagerDB:exec([[INSERT INTO TBL_Pendenz(PEN_Titel, PEN_Kommentar, PEN_Datum, PEN_Datum_yyyymmdd, PEN_Zeit, WAL_Kategorie, WAL_Prioritaet, PEN_Erledigt)
VALUES('Titel2', 'Kommentar2', '22.08.2022', 20220822, '14:40', 5, 3, 0);]])
But the values should be dynamic, so I assigned them to variables and now I try to issue the same INSERT statements with variables but I did not suceed. The last thing I tried was but build the SQL statement with a string the following way.
Code: Select all
;p_xxx are variables with the values I want to insert
;First I build the SQL INSERT statement
Local insertSQL$ = "INSERT INTO TBL_Pendenz(PEN_Titel, PEN_Kommentar, PEN_Datum, PEN_Datum_yyyymmdd, PEN_Zeit, WAL_Kategorie, WAL_Prioritaet, PEN_Erledigt) "
insertSQL$ = insertSQL$ .. "VALUES('" .. p_title$ .. "', '" .. p_comment$ .. "', '" .. p_duedate$ .. "', '" .. p_duedate_yyyymmdd$ .. "', '" .. p_duetime$ .. "', "
insertSQL$ = insertSQL$ .. p_category .. ", " .. p_priority .. ", 0);"
;Then I try to execute the statement
TaskManagerDB:exec(insertSLQ$)
Any hints?