I’m using sqflite in my Flutter application. In this example, date is the actual date(10.06.2021) and DATUM is the datafield in the DB. I keep getting this syntax error: E/SQLiteLog(30657): (1) near “.2021”: syntax error in “SELECT COUNT (*) FROM Shisha_table WHERE (YEAR(10.06.2021) – YEAR(DATUM)) = 1” Answer There is no YEAR() function in SQLite. The logic of your code
Tag: sqflite
How to save date in SQLite flutter database?
I am making an app in which users can fill a form and can save their financial transaction details for every transaction they make, for this, I want to add a date as well and also I want to fetch data using the date as well. I am creating my database as follows: I am mapping as follows: I have
Flutter Insert data into the database sqflite
I need to insert the data one at a time and add it to the end of the string, but what happens is that the way I’m doing is overwriting the data Output: This is my SQL: Output SQL: I need it to be like this: Answer According to my comment, use 3 tables : RECEIPTS id nameReceipt descReceipt 1
Can I do a case-based foreign key command (either cascade or set null)?
I would like to give the user the option when he is deleting an item in the parent table, to either cascade delete or set null to the items in the child table that references the foreign key, is that possible within SQLITE? or do I have to do this within my code? These are the commands I currently use