SQLite Forum

no such function: UNIXEPOCH

no such function: UNIXEPOCH

(1.2) By Peter V. (PeterV) on 2022-05-31 00:43:38 edited from 1.1 [link] [source]

Greetings Group:

Following problem only happens when connecting to a sqlite3 database and evaluating the query [0], yielding the result [1]. The same command works as intended via other languages, sqlite3 cli. Since TCL and SQLite are closely coupled, I am posting this observation here. Thanks for help, any ideas, clue-sticks...

[0] % cat sqlite3-eval.tcl #!/usr/bin/env tclsh8.6 package require sqlite3 sqlite3 db ./test.db db eval {SELECT UNIXEPOCH();}

[1] % ./sqlite3-eval.tcl no such function: UNIXEPOCH while executing "db eval {SELECT UNIXEPOCH();}" (file "./sqlite3-eval.tcl" line 4)

% sqlite3 --version 3.38.5 2022-05-06 15:25:27 78d9c993d404cdfaa7fdd2973fa1052e3da9f66215cff9c5540ebe55c407d9fe

% tclsh8.6 tclsh8.6 [~/sqlite] set tcl_version 8.6 tclsh8.6 [~/sqlite] package require sqlite3 3.35.4

(2) By Stephan Beal (stephan) on 2022-05-30 22:48:43 in reply to 1.0 [link] [source]

no such function: UNIXEPOCH

That command wasn't added until 3.38 (2022-02-22).

(3) By Peter V. (PeterV) on 2022-06-03 21:14:27 in reply to 2 [source]

Thank you, Stephan. It all works as expected.