forked from sm-shaw/db2tcl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
130 lines (82 loc) · 2.69 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
WHAT IS DB2TCL?
===============
DB2TCL is an extension to the Tool Command Language (TCL) that
provides access to a IBM UDB DB2 database server.
DB2TCL features:
-- supports multiple connections to one or more database servers,
-- supports all IBM DB2 statements,
-- returns SELECT query results either as TCL lists, or iterates
a script over the resulting rows,
-- supports database transactions.
WHERE TO GET DB2TCL?
====================
original - http://sourceforge.net/projects/db2tcl/
updated - https://github.com/memmertoIBM/db2tcl/
INSTALLATION
============
Quick install instructions:
- Untar db2tcl tarball
$ tar xzvf db2tcl-X.Y.Z.tar.gz
- Change dir to db2tcl-X.Y.Z
$ cd db2tcl-X.Y.Z
- run configure script
$ ./configure
- run make
$ make
- ckeck
$ make check
- to install switch to root
$ su -c 'make install'
REQUIREMENTS
============
Since DB2TCL is an extension to Tcl, you should already have Tcl, or be
prepared to get it via FTP:
ftp://ftp.scriptics.com/pub/tcl/
If you want compile Tk interface for IBM DB2 you must have
Tk library also.
Of course, you must also have access to a IBM DB2 system. Additionally,
you must have the IBM DB2 SDK package that provides header files and
object libraries. See IBM DB2 homepage:
http://www-3.ibm.com/software/data/db2/udb/
DB2TCL supports building a dynamic load library on systems that support
dynamic loading. If you build static libraries and executables,
I recommend building with Extended Tcl.
BRIEF COMMAND REFERENCE
=======================
db2_connect dbname ?username? ?password?
Connect to database dbname with username and password. Function
return database handle.
db2_disconnect db_handle
Disconnect from database and free database handle.
db2_select db_handle sql_commands
Execute select SQL command for given handle.
Return statement handle.
db2_execute db_handle sql_commands
Execute SQL command a database non-SELECT statement like INSERT,
DELETE, UPDATE.
db2_bind db2_handle sql_commands varibles
Bind varibles to data.
db2_fetchrow statement_handle ?number?
Fetch one row from dataset. If number is specified, returns a data
of this number column.
db2_finish statement_handle
Finish and free statement handle.
db2_getnumrow statement_handle
Return number column in statement.
db2_begin_transaction db_handle
Start transaction
db2_commit_transaction db_handle
Commit transaction
db2_rollback_transaction db_handle
Rollback transaction
db2_create_db dbname
Create database
db2_drop_db dbname
Drop database
db2_force_off
Run Db2 force application
NOTE
====
DB2TCL tested on Linux and Windows
Sergey N. Belinsky