Table des matières

MySQL TCL

Syntax

::mysql::connect ?option value...?
::mysql::use handle database
::mysql::sel handle sql-statement ?-list|-flatlist?
::mysql::fetch handle
::mysql::exec handle sql-statement
::mysql::query handle sql-select-statement
::mysql::endquery query-handle
::mysql::map handle binding-list script
::mysql::receive handle sql-statment binding-list script
::mysql::seek handle row-index
::mysql::col handle table-name option
::mysql::col handle table-name optionkist
::mysql::col handle ?option...?
::mysql::info handle option
::mysql::baseinfo option
::mysql::ping handle
::mysql::changeuser user password ?database?
::mysql::result handle option
::mysql::state handle ?-numeric?
::mysql::close ?handle?
::mysql::insertid handle
::mysql::escape ?handle? string
::mysql::autocommit handle boolean
::mysql::commit handle
::mysql::rollback handle
::mysql::nextresult handle
::mysql::moreresult handle
::mysql::warningcount handle
::mysql::isnull value
::mysql::newnull
::mysql::setserveroption handle option
::mysql::shutdown handle
::mysql::encoding handle ?encoding?

Description

MySQLTcl is a collection of Tcl commands and a Tcl global array that provide access to MySQL database servers.

MySQLTcl is nothing more than a patched version of a patched version of Hakan Soderstrom's patch of Tom Poindexter's Sybtcl.

Mysqltcl is binary Tcl library (extension) written in C language that use direkt official MySQL C-API. Almost all Tcl commands correspond to MySQL C-API functions. For detail documentation see official MySQL C-API manual.

connect

::mysql::connect ?option value...?

Connect to a MySQL server. A handle is returned which should be used in other mysqltcl commands using this connection. ::mysql::connect raises a Tcl error if the connection fails. ::mysql::connect read first the options from my.cnf file group mysqltcl. See MySQL documentation chapter “options files”. Possible connection options are:

use

::mysql::use handle database

Associate a connected handle with a particular database. handle must be a valid handle previously obtained from ::mysql::connect. mysql::use raises a Tcl error if the handle is not valid or if the database name specified could not be used.

Consider you can use mysqltcl without to specify the database, in this case you must use explizit schema notation to specify the table in sql.

::mysql::sel $handle {select * from uni.student}

with option connect -noschema you can prohibit such syntax.

Examples

See also

Package, http://www.xdobry.de/mysqltcl/mysqltcl.html