SQL error: out of memory

Hi there!I have a problem with sql.I am trying to build a db with 3 tables: Users, Products and Actions.The last one has the UIDs of the first two.Whan I'm trying to create the Actions table I get this error:


The SQL command for creating this table looks like this: CREATE TABLE Actions (ID INTEGER PRIMARY KEY, Timestamp TIMESTAMP NOT NULL, TypeID INTEGER NOT NULL, UserID REFERENCES Users , ProductID REFERENCES Products, Credit FLOAT(4,2), Quantity INTEGER);
I've tried to change it to this: CREATE TABLE Actions (ID INTEGER PRIMARY KEY, Timestamp TIMESTAMP NOT NULL, TypeID INTEGER NOT NULL, UserID REFERENCES Users(ID) , ProductID REFERENCES Products(ID), Credit FLOAT(4,2), Quantity INTEGER); but it doesn't seem to work as well because I get this error message:

Using a SQLite Online Compiler I've created the tables without any problem.You can see the commands in this page http://tpcg.io/CD89X0
I have to mention that I'm using a ESP8266 module(NodeMCU 1.0(ESP-12E Module to be more precise))

Perhaps this discussion is of use - it suggests you should explicitly use FOREIGN KEY
https://stackoverflow.com/questions/19186388/references-keyword-in-sqlite3

Hi @MarkT , thanks for your reply!I've tried to change my sql code in this CREATE TABLE Actions (ID integer,Timestamp timestamp not null, TypeID integer not null, UserID integer,ProductID integer, Credit float(4,2), Quantity int ,foreign key (UserID) references Users(id),foreign key (ProductID) references Products(id),primary key (ID)); and it doesn't seem to work either.This link willl redirect you to the SQL Compiler code that I've wrote: SQL Online Compiler.Also, this is the error that I'm getting from my ESP8266:


I've checked the code over and over and I can't find any problem.Any ideea what I;m missing?
Regards, Cozinia.

No idea but did you notice in that link the bit about enabling foreign keys in SQLLite?

Yes, I've tried that and it doesn't seem to resolve the issue I'm having.Thanks for your advice though.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.