I think your problem may be that fun() in your eval is being called both from tcl and from sqlite. Name your proc fun2 and the problem will probably go away.
Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate ________________________________________ From: [email protected] [[email protected]] on behalf of John [[email protected]] Sent: Sunday, February 27, 2011 8:37 PM To: General Discussion of SQLite Database Subject: EXT :[sqlite] "select disctict" calles tcl functions twice? Hi All, In my example code here the function "fun" is called twice for each row. The first set of calls is made in the initial evaluation of the sql statement, then "fun" is called again as the tcl body is evaluated for each row. I wasn't expecting this. Thanks, John ------------------------ lappend auto_path /home/john/lib package require sqlite3 sqlite3 db data.db proc fun {} { puts "Fun Called" incr ::count } db function fun fun db eval { select distinct *, fun() as H from T } T { puts "$T(x), $T(H)" } _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

