Mercurial > sqlpython
annotate sqlpython/exampleSession.txt @ 306:ed02c8b1a9b6
folded in py session work
author | catherine@dellzilla |
---|---|
date | Wed, 25 Mar 2009 14:37:34 -0400 |
parents | 6ffe31149306 |
children | 0473ad96ddb7 |
rev | line source |
---|---|
189 | 1 SQL.No_Connection> connect testschema/testschema@orcl |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
2 0:testschema@orcl> CREATE TABLE play ( |
189 | 3 > title VARCHAR2(40) CONSTRAINT xpk_play PRIMARY KEY, |
4 > author VARCHAR2(40)); | |
5 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
6 Executed (1 rows) |
189 | 7 |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
8 0:testschema@orcl> INSERT INTO play VALUES ('Twelfth Night', 'Shakespeare'); |
189 | 9 |
10 Executed (1 rows) | |
11 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
12 0:testschema@orcl> INSERT INTO play VALUES ('The Tempest', 'Shakespeare'); |
189 | 13 |
14 Executed (1 rows) | |
15 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
16 0:testschema@orcl> INSERT INTO play VALUES ('Agamemnon', 'Aeschylus'); |
189 | 17 |
18 Executed (1 rows) | |
19 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
20 0:testschema@orcl> commit; |
189 | 21 |
22 Executed | |
23 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
24 0:testschema@orcl> select |
189 | 25 > * |
26 > from | |
27 > play; | |
28 | |
29 TITLE AUTHOR | |
30 ------------- ----------- | |
31 Twelfth Night Shakespeare | |
32 The Tempest Shakespeare | |
33 Agamemnon Aeschylus | |
34 | |
35 3 rows selected. | |
36 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
37 0:testschema@orcl> ls |
189 | 38 |
39 NAME | |
40 -------------- | |
41 INDEX/XPK_PLAY | |
42 TABLE/PLAY | |
43 | |
44 2 rows selected. | |
45 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
46 0:testschema@orcl> ls table/* |
189 | 47 |
48 NAME | |
49 ---------- | |
50 TABLE/PLAY | |
51 | |
52 1 row selected. | |
53 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
54 0:testschema@orcl> desc play |
189 | 55 TABLE TESTSCHEMA.PLAY |
56 | |
57 COLUMN_NAME Null? DATA_TYPE | |
58 ----------- -------- ------------ | |
59 TITLE NOT NULL VARCHAR2(40) | |
60 AUTHOR NULL VARCHAR2(40) | |
61 | |
62 2 rows selected. | |
63 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
64 0:testschema@orcl> COMMENT ON COLUMN play.author IS 'Primary author (if multiple)'; |
189 | 65 |
66 Executed | |
67 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
68 0:testschema@orcl> COMMENT ON TABLE play IS 'I like plays.'; |
189 | 69 |
70 Executed | |
71 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
72 0:testschema@orcl> comments play |
189 | 73 TABLE TESTSCHEMA.PLAY: I like plays. |
74 | |
75 COLUMN_NAME COMMENTS | |
76 ----------- ---------------------------- | |
77 TITLE None | |
78 AUTHOR Primary author (if multiple) | |
79 | |
80 2 rows selected. | |
81 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
82 0:testschema@orcl> cat play |
189 | 83 |
84 TITLE AUTHOR | |
85 ------------- ----------- | |
86 Twelfth Night Shakespeare | |
87 The Tempest Shakespeare | |
88 Agamemnon Aeschylus | |
89 | |
90 3 rows selected. | |
91 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
92 0:testschema@orcl> help terminators |
189 | 93 ; standard Oracle format |
94 \c CSV (with headings) | |
95 \C CSV (no headings) | |
96 \g list | |
97 \G aligned list | |
98 \h HTML table | |
99 \i INSERT statements | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
100 \j JSON |
189 | 101 \s CSV (with headings) |
102 \S CSV (no headings) | |
103 \t transposed | |
104 \x XML | |
105 \l line plot, with markers | |
106 \L scatter plot (no lines) | |
107 \b bar graph | |
108 \p pie chart | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
109 0:testschema@orcl> select * from play where author='Shakespeare'\c |
189 | 110 |
111 TITLE,AUTHOR | |
112 "Twelfth Night","Shakespeare" | |
113 "The Tempest","Shakespeare" | |
114 | |
115 2 rows selected. | |
116 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
117 0:testschema@orcl> select * from play where author='Shakespeare'\g |
189 | 118 |
119 | |
120 | |
121 **** Row: 1 | |
122 TITLE: Twelfth Night | |
123 AUTHOR: Shakespeare | |
124 | |
125 **** Row: 2 | |
126 TITLE: The Tempest | |
127 AUTHOR: Shakespeare | |
128 | |
129 | |
130 2 rows selected. | |
131 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
132 0:testschema@orcl> select * from play where author='Shakespeare'\h |
189 | 133 |
134 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
135 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
136 <head> | |
137 <title>play</title> | |
138 <meta http-equiv="content-type" content="text/html;charset=utf-8"/> | |
139 </head> | |
140 <body> | |
141 <table id="play" summary="Result set from query on table play"> | |
142 <tr> | |
143 <th id="header_title"> | |
144 title | |
145 </th><th id="header_author"> | |
146 author | |
147 </th> | |
148 </tr> | |
149 <tr> | |
150 <td headers="header_title"> | |
151 Twelfth Night | |
152 </td><td headers="header_author"> | |
153 Shakespeare | |
154 </td> | |
155 </tr><tr> | |
156 <td headers="header_title"> | |
157 The Tempest | |
158 </td><td headers="header_author"> | |
159 Shakespeare | |
160 </td> | |
161 </tr> | |
162 </table> | |
163 </body> | |
164 </html> | |
165 | |
166 2 rows selected. | |
167 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
168 0:testschema@orcl> select * from play\i |
189 | 169 |
170 | |
171 INSERT INTO play (TITLE, AUTHOR) VALUES ('Twelfth Night', 'Shakespeare'); | |
172 INSERT INTO play (TITLE, AUTHOR) VALUES ('The Tempest', 'Shakespeare'); | |
173 INSERT INTO play (TITLE, AUTHOR) VALUES ('Agamemnon', 'Aeschylus'); | |
174 | |
175 3 rows selected. | |
176 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
177 0:testschema@orcl> select * from play where author='Shakespeare'\t |
189 | 178 |
179 | |
180 COLUMN NAME ROW N.1 ROW N.2 | |
181 ----------- ------------- ----------- | |
182 TITLE Twelfth Night The Tempest | |
183 AUTHOR Shakespeare Shakespeare | |
184 | |
185 2 rows selected. | |
186 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
187 0:testschema@orcl> select * from play where author='Shakespeare'\x |
189 | 188 |
189 | |
190 <xml> | |
191 <play_resultset> | |
192 <play> | |
193 <title>Twelfth Night</title> | |
194 <author>Shakespeare</author> | |
195 </play> | |
196 <play> | |
197 <title>The Tempest</title> | |
198 <author>Shakespeare</author> | |
199 </play> | |
200 </play_resultset> | |
201 </xml> | |
202 | |
203 2 rows selected. | |
204 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
205 0:testschema@orcl> set |
189 | 206 autobind: False |
207 commit_on_exit: True | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
208 continuation_prompt: > |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
209 default_file_name: afiedt.buf |
189 | 210 echo: False |
232
52adb09094b3
fixed bugs in VC introduced by sort-order options
catherine@dellzilla
parents:
210
diff
changeset
|
211 editor: gedit |
52adb09094b3
fixed bugs in VC introduced by sort-order options
catherine@dellzilla
parents:
210
diff
changeset
|
212 heading: True |
189 | 213 maxfetch: 1000 |
214 maxtselctrows: 10 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
215 prompt: 0:testschema@orcl> |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
216 result_history_max_mbytes: 10 |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
217 scan: True |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
218 serveroutput: True |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
219 sql_echo: False |
189 | 220 timeout: 30 |
232
52adb09094b3
fixed bugs in VC introduced by sort-order options
catherine@dellzilla
parents:
210
diff
changeset
|
221 timing: False |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
222 wildsql: False |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
223 |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
224 0:testschema@orcl> set autobind on |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
225 autobind - was: False |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
226 now: True |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
227 |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
228 0:testschema@orcl> select * from play where author like 'A%'; |
189 | 229 |
230 TITLE AUTHOR | |
231 --------- --------- | |
232 Agamemnon Aeschylus | |
233 | |
234 1 row selected. | |
235 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
236 0:testschema@orcl> print |
189 | 237 :1 = Agamemnon |
238 :2 = Aeschylus | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
239 :author = Aeschylus |
189 | 240 :title = Agamemnon |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
241 0:testschema@orcl> select * from play where title = :1; |
189 | 242 |
243 TITLE AUTHOR | |
244 --------- --------- | |
245 Agamemnon Aeschylus | |
246 | |
247 1 row selected. | |
248 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
249 0:testschema@orcl> select * from play where author = :author; |
189 | 250 |
251 TITLE AUTHOR | |
252 --------- --------- | |
253 Agamemnon Aeschylus | |
254 | |
255 1 row selected. | |
256 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
257 0:testschema@orcl> help grep |
189 | 258 grep PATTERN TABLE - search for term in any of TABLE's fields |
259 Usage: grep [options] arg | |
260 | |
261 Options: | |
262 -h, --help show this help message and exit | |
263 -i, --ignore-case Case-insensitive search | |
264 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
265 0:testschema@orcl> grep -i EM play |
189 | 266 play |
267 | |
268 TITLE AUTHOR | |
269 ----------- ----------- | |
270 The Tempest Shakespeare | |
271 Agamemnon Aeschylus | |
272 | |
273 2 rows selected. | |
274 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
275 0:testschema@orcl> -- \d command inspired by postgresql's psql |
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
276 0:testschema@orcl> \dt |
201 | 277 |
278 TABLE_NAME TYPE | |
279 ---------- ----- | |
280 PLAY TABLE | |
281 | |
282 1 row selected. | |
283 | |
277 | 284 0:testschema@orcl> \di play |
201 | 285 |
277 | 286 OWNER INDEX_NAME INDEX_TYPE |
287 ---------- ---------- ---------- | |
288 TESTSCHEMA XPK_PLAY NORMAL | |
201 | 289 |
290 1 row selected. | |
291 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
292 0:testschema@orcl> CREATE OR REPLACE VIEW review |
201 | 293 > AS |
294 > SELECT title, author, 'A masterpiece!' review | |
295 > FROM play; | |
296 | |
297 Executed | |
298 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
299 0:testschema@orcl> \dv |
201 | 300 |
301 VIEW_NAME TYPE | |
302 --------- ---- | |
303 REVIEW VIEW | |
304 | |
305 1 row selected. | |
306 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
307 0:testschema@orcl> cat review |
201 | 308 |
309 TITLE AUTHOR REVIEW | |
310 ------------- ----------- -------------- | |
311 Twelfth Night Shakespeare A masterpiece! | |
312 The Tempest Shakespeare A masterpiece! | |
313 Agamemnon Aeschylus A masterpiece! | |
314 | |
315 3 rows selected. | |
316 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
317 0:testschema@orcl> drop view review; |
201 | 318 |
319 Executed | |
320 | |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
321 0:testschema@orcl> drop table play; |
189 | 322 |
323 Executed | |
210 | 324 |
276
0b7031c2229e
autobind unit test failing
catherine@Elli.myhome.westell.com
parents:
232
diff
changeset
|
325 0:testschema@orcl> foo |
210 | 326 |
327 bar |