Skip to site navigation

Web support banner

Calling MySQL from Tcl

MySQL databases can be accessed by scripts written in the Tcl scripting language on Socrates and Plato. The following example examines table people in database ucabwww, owned by user ucabwww:

% package require mysqltcl
% set h [mysqlconnect -h -u ucabwww -password secret]
% mysqluse $h ucabwww
% mysqlsel $h "select name,age from people" -list
{fred 23} {mary 34} {john 44} {jane 56} {tony 98}
% mysqlclose $h
% exit

Detailed documentation of mysqltcl can be found at

Page last modified on 14 apr 10 09:55