Alright, trying to set the scenario:
* I open/create a database
* I register a custom function called HASH (set to be deterministic), tested and working
* I create a bunch of tables (if not exists)
So far, everything works fine.

Then, the troublesome create:
CREATE TABLE IF NOT EXISTS Programmes (
ID NVARCHAR(64) UNIQUE NOT NULL PRIMARY KEY DEFAULT (HASH(Title, Year, EpNo2)),
    Title NVARCHAR(100) NOT NULL,
    Description NVARCHAR(1000),
    Year NVARCHAR(10),
    EpNo1 NVARCHAR(50),
    EpNo2 NVARCHAR(100))

This query raises the following exception:
Unable to create table default value of column [ID] is not constant

Is it not possible to use custom functions this way?
I tried with random() on another table and that works.

Any ideas and explanations would be appreciated.
/Jörgen

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to