]> git.sven.stormbind.net Git - sven/mysqltcl.git/blob - tests/test2.tcl
releasing package mysqltcl version 3.052-4
[sven/mysqltcl.git] / tests / test2.tcl
1 #!/usr/bin/tcl
2 # Simple Test file to test all mysqltcl commands and parameters
3 # please create test database first
4 # from test.sql file
5 # >mysql -u root
6 # >create database uni;
7 #
8 # >mysql -u root <test.sql
9 # please adapt the parameters for mysqlconnect some lines above
10
11 if {[file exists libload.tcl]} {
12     source libload.tcl
13 } else {
14     source [file join [file dirname [info script]] libload.tcl]
15 }
16
17 set handle [mysqlconnect -user root]
18
19 # use implicit database notation
20 puts "1 rows [mysqlsel $handle {select * from uni.Student}]"
21 puts "1 Table-col [mysqlcol $handle -current {name type length table non_null prim_key decimals numeric}]"
22 puts "1 [mysqlnext $handle]"
23
24 # Test sel and next functions
25 mysqluse $handle uni
26 puts "rows [mysqlsel $handle {select * from Student} -list]"