SQLite Forum

Generated Columns
Login
New to SQL. I want to create a Generated or Computed column in one of my database tables. I tried with my own data, and it is not working, so I have gone back to the example in the SQLite documentation:

CREATE TABLE Products( 
    Id INTEGER PRIMARY KEY, 
    Name TEXT,
    Qty INT,
    Price INT,
    TotalValue INT GENERATED ALWAYS AS (Qty * Price)
);

And I keep getting the same error every time:

[12:27:47] Error while executing SQL query on database 'Tester2': near "AS": syntax error


I have SQLite 3.32.3 and am using SQLiteStudio 3.2.1. Other than the need to have SQLite > 3.31.0 for creating GENERATED COLUMNS, not sure what the issue is. Any help would be greatly appreciated!!

Thanks