Hello,
I just try a hunderet times but I can't fix it..
I created a new table: CREATE TABLE 'erfassungsbeleg' ('id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 'personal' INTEGER, 'name' CHAR,'kostentraeger' INTEGER,'stunden' INTEGER,'taetigkeit' INTEGER,'epoch' INTEGER, 'date' INTEGER)
This worked. But if i want to insert sth to the database there is always a problem with the column "name" because this is a word/name (if i set numbers in the string it worked but with words in the string it doesn t).
[{"id":"30814450.0881bc","type":"inject","z":"f8fb4f16.cdbf78","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":200,"wires":[["8355bd56.24fd38"]]},{"id":"8355bd56.24fd38","type":"function","z":"f8fb4f16.cdbf78","name":"SQL","func":"// Leerer String wird als Variable sql angelegt\nvar sql = \"\";\n// Das Datum wird deklariert\nvar d = new Date();\nvar epoch = d.getTime();\nvar year = d.getFullYear();\nvar monthX = d.getMonth()+1; \nvar dayX = d.getDate();\nif(monthX.toString().length == 1) \n{\nvar monthX = '0'+monthX;\n}\nif(dayX.toString().length == 1) \n{\nvar dayX = '0'+dayX;\n} \nvar today = year+monthX+dayX;\n// Leeres Objekt wird erstellt\nvar outputs = [];\n\nvar nam = \"text\";\nvar id = \"2571\";\nvar kosten = \"23\";\nvar stunden = \"8\";\nvar index = \"40\";\n\n\n\n\n\nsql = \"INSERT INTO erfassungsbeleg (personal,name,kostentraeger,stunden,taetigkeit,epoch,date)\" +\n \"VALUES (\"+id+','+nam+\",\"+kosten+\",\"+stunden+\",\"+index+\",\"+epoch+\",\"+today+\")\";\n outputs.push({topic:sql});\n\n\nreturn [ outputs ];","outputs":1,"noerr":0,"x":570,"y":400,"wires":[["2c99cd56.4625ba"]]},{"id":"2c99cd56.4625ba","type":"sqlite","z":"f8fb4f16.cdbf78","mydb":"bff91f4.bf534e","sqlquery":"msg.topic","sql":"","name":"SQLite","x":790,"y":400,"wires":[[]]},{"id":"e0e361f4.136f48","type":"inject","z":"f8fb4f16.cdbf78","name":"","topic":"CREATE TABLE 'erfassungsbeleg' ('id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 'personal' TEXT, 'name' CHAR,'kostentraeger' INTEGER,'stunden' INTEGER,'taetigkeit' INTEGER,'epoch' INTEGER, 'date' INTEGER)","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":480,"y":620,"wires":[["2c99cd56.4625ba"]]},{"id":"bff91f4.bf534e","type":"sqlitedb","z":"","db":"C:\\Users\\name\\SQLite\\sqlite","mode":"RW"}]
Maybe I m too stupid..