File: dio.en.html

package info (click to toggle)
rivet 0.5.0-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,664 kB
  • ctags: 1,359
  • sloc: sh: 8,342; xml: 6,622; ansic: 4,367; tcl: 2,813; makefile: 99; lisp: 78; sql: 25
file content (218 lines) | stat: -rw-r--r-- 39,356 bytes parent folder | download | duplicates (2)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>DIO - Database Interface Objects</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.en.html" title="Apache Rivet"><link rel="up" href="index.en.html" title="Apache Rivet"><link rel="prev" href="tcl_packages.en.html" title="Rivet Tcl Packages"><link rel="next" href="dio.en.html#id4764819" title="DIO"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">DIO - Database Interface Objects</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="tcl_packages.en.html"><img src="images/prev.png" alt="Prev"></a></td><th width="60%" align="center"></th><td width="20%" align="right"><a accesskey="n" href="dio.en.html#id4764819"><img src="images/next.png" alt="Next"></a></td></tr></table></div><div class="section" lang="en"><div class="titlepage"><div><div><hr><h2 class="title" style="clear: both"><a name="dio"></a>DIO - Database Interface Objects</h2></div></div></div><div class="toc"><dl><dt><a href="dio.en.html#id4764819">DIO</a> - Database Interface Objects</dt></dl></div><div class="refentry" lang="en"><a name="id4764819"></a><div class="titlepage"></div><div class="refnamediv"><h3>Name</h3><p><h3 style="text-indent: 3em">DIO &#8212; Database Interface Objects</h3></p></div><div class="refsynopsisdiv"><h3>Synopsis</h3><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::DIO::handle</span>   <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>interface</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>? (<span style="font-family:monospace; font-weight: bold;">-option</span> | <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>option</tt></i></span> | <span style="font-family:monospace; font-weight: bold;">-option</span> | <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>option</tt></i></span> | <span style="font-family:monospace; font-weight: bold;">...</span>)</div></div></div><div class="refsect1" lang="en"><h3>Description</h3><p style="width:90%">
	  <span style="font-family:monospace"><span><b class="command">DIO</b></span></span> is designed to be a generic,
	  object-oriented interface to SQL databases.  Its main goal
	  is to be as generic as possible, but since not all SQL
	  databases support the exact same syntaxes, keeping code
	  generic between databases is left to the abilities of the
	  programmer.  DIO simply provides a way to keep the Tcl
	  interface generic.
	</p><p style="width:90%">
	  interface - The name of the database
	  interface.  Currently supported interfaces are
	  Postgresql and Mysql.
	</p><p style="width:90%">
	  If <i class="replaceable"><tt>objectName</tt></i> is
	  specified, DIO creates an object of that name.  If there is
	  no <i class="replaceable"><tt>objectName</tt></i>
	  given, DIO will automatically generate a unique object ID
	</p></div><div class="refsect1" lang="en"><h3>Options</h3><div class="variablelist"><dl><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-host</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>hostname</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		The hostname of the computer to connect to.  If none
		is given, DIO assumes the local host.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-port</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>portNumber</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">The port number to connect to on hostname.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-user</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>username</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">The username you wish to login to the server as.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-pass</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>password</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">The password to login to the server with.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-db</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>database</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		The name of the database to connect to.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-table</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>tableName</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		The default table to use when using built-in commands
		for storing and fetching.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-keyfield</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>keyFieldname</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		The default field to use as the primary key when using
		built-in commands for storing and fetching.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-autokey</span>  (<span style="font-family:monospace; font-weight: bold;">1</span> | <span style="font-family:monospace; font-weight: bold;">0</span>)</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		If this option is set to 1, DIO will attempt to
		determine an automatic key for
		keyField when storing and fetching.
		In most databases, this requires that the
		sequence also be specified.  In the
		case of MySQL, where sequences do not exist, autokey
		must be used in conjunction with a table which has a
		field specified as AUTO.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-sequence</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>sequenceName</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		If DIO is automatically generating keys, it will use
		this sequence as a means to gain a unique number for
		the stored key.</div></div></dd></dl></div></div><div class="refsect1" lang="en"><h3>DIO Object Commands</h3><div class="variablelist"><dl><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">array</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>request</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Execute request as a SQL query and
		create an array from the first record found.  The
		array is set with the fields of the table and the
		values of the record found.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">autokey</span>? (<span style="font-family:monospace; font-weight: bold;">value</span> | <span style="font-family:monospace; font-weight: bold;">boolean</span>)</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current autokey value.  If
		value is specified, it sets a new
		value for the autokey option.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">close</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">	      Close the current database connection.  This command is
		automatically called when the DIO object is destroyed.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">db</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current database.  If
		value is specified, it sets a new
		value for the database.  In most cases, the DIO object
		will automatically connect to the new database when
		this option is changed.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">delete</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>key</tt></i></span>? (<span style="font-family:monospace; font-weight: bold;">-option</span> | <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>option</tt></i></span> | <span style="font-family:monospace; font-weight: bold;">...</span>)</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Delete a record from the database where the primary
		key matches key.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">destroy</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Destroy the DIO object.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">errorinfo</span>? ?<span style="font-family:monospace; font-weight: bold;">value</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">errorinfo contains the value of
		the last error, if any, to occur while executing a
		request.  When a request fails for any reason, this
		variable is filled with the error message from the SQL
		interface package.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">exec</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>request</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Execute request as an SQL query.
		When the exec command is called, the query is
		executed, and a DIO result object is returned.  From
		there, the result object can be used to obtain
		information about the query status and records in a
		generic way.  See <a href="dio.en.html#resultobj" title="Result Object Commands">Result
		  Object Commands</a>
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">fetch</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>key</tt></i></span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>arrayName</tt></i></span>? (<span style="font-family:monospace; font-weight: bold;">-option</span> | <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>option</tt></i></span> | <span style="font-family:monospace; font-weight: bold;">...</span>)</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Fetch a record from the database where the primary key
		matches key and store the result in
		an array called arrayName.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">host</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current host value.  If
		value is specified, it sets a new
		value for the host.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">insert</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>arrayName</tt></i></span>? (<span style="font-family:monospace; font-weight: bold;">-option</span> | <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>option</tt></i></span> | <span style="font-family:monospace; font-weight: bold;">...</span>)</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Insert fields from arrayName into the specified table in the database.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">keyfield</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current keyfield.  If
		value is specified, it sets a new
		value for the keyfield.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">keys</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>pattern</tt></i></span>? (<span style="font-family:monospace; font-weight: bold;">-option</span> | <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>option</tt></i></span> | <span style="font-family:monospace; font-weight: bold;">...</span>)</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return a list of keys in the database.  If
		pattern is specified, only the keys
		matching will be returned.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">lastkey</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the last key that was used from
		sequence.  If sequence has not been
		specified, this command returns an empty string.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">list</span>? ?<span style="font-family:monospace; font-weight: bold;">request</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Execute request as a SQL query and
		return a list of the first column of each record
		found.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">nextkey</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">Increment sequence and return the
		next key to be used.  If sequence has not been
		specified, this command returns an empty
		string.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">open</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">Open the connection to the current database.  This
		command is automatically called from any command which
		accesses the database.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">pass</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current pass value.  If
		value is specified, it sets a new
		value for the password.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">port</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">Return the current port value.  If value is
		specified, it sets a new value for the port.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">sequence</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current sequence value.  If value is
		specified, it sets a new value for the sequence.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">store</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>arrayName</tt></i></span>? (<span style="font-family:monospace; font-weight: bold;">-option</span> | <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>option</tt></i></span> | <span style="font-family:monospace; font-weight: bold;">...</span>)</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Store arrayName in the database, inserting it if the corresponding record isn't there, or updating it if it is.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">string</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>request</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Execute request as a SQL query and
		return a string containing the first record
		found.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">table</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">Return the current table.  If
		value is specified, it sets a new
		value for the table.</div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>objectName</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">user</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current user value.  If
		value is specified, it sets a new
		value for the user.
	      </div></div></dd></dl></div></div><div class="refsect1" lang="en"><a name="resultobj"></a><h3>Result Object Commands</h3><div class="variablelist"><dl><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>resultObj</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">autocache</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current autocache value.  If
		value is specified, it sets a new
		value for autocache.
	      </div><div style="margin-bottom:1.5ex ; padding .5ex">
		If autocache is true, the result object will
		automatically cache rows as you use them.  This means
		that the first time you execute a forall command, each
		row is being cached in the result object itself and
		will no longer need to access the SQL result.
		<span class="emphasis"><em>Default is true</em></span>.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>resultObj</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">cache</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Cache the results of the current SQL result in the
		result object itself.  This means that even if the
		database connection is closed and all the results of
		the DIO object are lost, this result object will still
		maintain a cached copy of its records.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>resultObj</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">errorcode</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current errorcode value.  If value
		is specified, it sets a new value for errorcode.
	      </div><div style="margin-bottom:1.5ex ; padding .5ex">
		errorcode contains the current code from the
		SQL database which specifies the result of the query
		statement which created this object.  This variable
		can be used to determine the success or failure of a
		query.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>resultObj</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">errorinfo</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current errorinfo value.  If value
		is specified, it sets a new value for errorinfo.
	      </div><div style="margin-bottom:1.5ex ; padding .5ex">
		If an error occurred during the SQL query, DIO
		attempts to set the value of errorinfo to the
		resulting error message.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>resultObj</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">fields</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current fields value.  If
		value is specified, it sets a new
		value for fields.
	      </div><div style="margin-bottom:1.5ex ; padding .5ex">
		fields contains the list of fields
		used in this query.  The fields are in order of the
		fields retrieved for each row.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>resultObj</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">forall</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>-type</tt></i></span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>varName</tt></i></span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>body</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Execute body over each record in the
		result object.
	      </div><div style="margin-bottom:1.5ex ; padding .5ex">Types:</div><div class="variablelist"><dl><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-array</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		      Create
		      <i class="replaceable"><tt>varName</tt></i>
		      as an array where the indexes are the names of
		      the fields in the table and the values are the
		      values of the current row.
		    </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-keyvalue</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		      Set
		      <i class="replaceable"><tt>varName</tt></i>
		      to a list containing key-value pairs of fields
		      and values from the current row. (-field value
		      -field value)
		    </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-list</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		      Set
		      <i class="replaceable"><tt>varName</tt></i>
		      to a list that contains the values of the
		      current row.
		    </div></div></dd></dl></div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>resultObj</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">next</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>-type</tt></i></span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>varName</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Retrieve the next record in the result object.
	      </div><div style="margin-bottom:1.5ex ; padding .5ex">Types:</div><div class="variablelist"><dl><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-array</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		      Create
		      <i class="replaceable"><tt>varName</tt></i>
		      as an array where the indexes are the names of
		      the fields in the table and the values are the
		      values of the current row.
		    </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-keyvalue</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		      Set
		      <i class="replaceable"><tt>varName</tt></i>
		      to a list containing key-value pairs of fields
		      and values from the current row. (-field value
		      -field value)
		    </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-list</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		      Set
		      <i class="replaceable"><tt>varName</tt></i>
		      to a list that contains the values of the
		      current row.
		    </div></div></dd></dl></div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>resultObj</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">numrows</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current numrows value.  If value is
		specified, it sets a new value for numrows.
	      </div><div style="margin-bottom:1.5ex ; padding .5ex">
		numrows is the number of rows in this result.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>resultObj</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">resultid</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current resultid value.  If value is
		specified, it sets a new value for resultid.
	      </div><div style="margin-bottom:1.5ex ; padding .5ex">
		resultid in most databases is the result
		pointer which was given us by the database.  This
		variable is not generic and should not really be used,
		but it's there if you want it.
	      </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>resultObj</tt></i></span>  ?<span style="font-family:monospace; font-weight: bold;">rowid</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex">
		Return the current rowid value.  If value is
		specified, it sets a new value for rowid.
	      </div><div style="margin-bottom:1.5ex ; padding .5ex">
		rowid contains the number of the
		current result record in the result object.  This
		variable should not really be accessed outside of the
		result object, but it's there if you want it.
	      </div></div></dd></dl></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tcl_packages.en.html"><img src="images/prev.png" alt="Prev"></a></td><td width="20%" align="center"><a accesskey="u" href="index.en.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"><a accesskey="n" href="dio.en.html#id4764819"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Rivet Tcl Packages</td><td width="20%" align="center"><a accesskey="h" href="index.en.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top">DIO</td></tr></table></div></body></html>