Mercurial > sqlpython
comparison docs/source/capabilities.rst @ 283:80484bc60bdd
still needs refs
author | catherine@dellzilla |
---|---|
date | Thu, 19 Mar 2009 17:30:53 -0400 |
parents | 4eef08cfaf25 |
children | abb4c6524113 |
comparison
equal
deleted
inserted
replaced
282:4eef08cfaf25 | 283:80484bc60bdd |
---|---|
82 When `< {filename}` is included in your command, it is replaced with the contents of | 82 When `< {filename}` is included in your command, it is replaced with the contents of |
83 {filename} before the command is run. | 83 {filename} before the command is run. |
84 | 84 |
85 Examples:: | 85 Examples:: |
86 | 86 |
87 Need examples!!!! | |
88 | |
87 Special output formats | 89 Special output formats |
88 ====================== | 90 ====================== |
89 | 91 |
90 By replacing the `;` that terminates a SELECT statement with a backslash-character | 92 By replacing the `;` that terminates a SELECT statement with a backslash-character |
91 sequence, you can get output in a number of useful formats. The `terminators` | 93 sequence, you can get output in a number of useful formats. The `terminators` |
92 command lists them, for your convenience:: | 94 command lists them, for your convenience. |
93 | 95 |
94 === ======================== ================================ | 96 ========== ======================== ================================ |
95 Especially useful for | 97 terminator format Useful for |
96 === ======================== ================================ | 98 ========== ======================== ================================ |
97 ; standard Oracle format | 99 ; standard Oracle format |
98 \c CSV (with headings) sending to spreadsheets | 100 \\c CSV (with headings) sending to spreadsheets |
99 \C CSV (no headings) | 101 \\C CSV (no headings) |
100 \g list wide output with linewraps | 102 \\g list wide output with linewraps |
101 \G aligned list | 103 \\G aligned list |
102 \h HTML table web reports | 104 \\h HTML table web reports |
103 \i INSERT statements copying to other instances | 105 \\i INSERT statements copying to other instances |
104 \j JSON | 106 \\j JSON |
105 \s CSV (with headings) | 107 \\s CSV (with headings) |
106 \S CSV (no headings) | 108 \\S CSV (no headings) |
107 \t transposed "narrow" tables like v$database | 109 \\t transposed "narrow" tables like v$database |
108 \x XML | 110 \\x XML |
109 \l line plot, with markers | 111 \\l line plot, with markers |
110 \L scatter plot (no lines) | 112 \\L scatter plot (no lines) |
111 \b bar graph | 113 \\b bar graph |
112 \p pie chart | 114 \\p pie chart |
113 === ======================== ================================ | 115 ========== ======================== ================================ |
114 | 116 |
115 Most of these output formats are even more useful when combined with special output | 117 Most of these output formats are even more useful when combined with special output |
116 destinations. For example, `SELECT * FROM party\h > /var/www/party_report.html` | 118 destinations. For example, `SELECT * FROM party\h > /var/www/party_report.html` |
117 could create an HTML report in the webserver's documents directory, ready to serve. | 119 could create an HTML report in the webserver's documents directory, ready to serve. |
118 | 120 |
142 cat {remainder of query} | 144 cat {remainder of query} |
143 Shorthand for "SELECT * FROM". Can be combined with anything else | 145 Shorthand for "SELECT * FROM". Can be combined with anything else |
144 that fits into a SELECT statement (WHERE, ORDER BY, etc.) | 146 that fits into a SELECT statement (WHERE, ORDER BY, etc.) |
145 | 147 |
146 grep {grep {target} {table} [{table2,...}] | 148 grep {grep {target} {table} [{table2,...}] |
147 Equivalent to SELECT * FROM {table} WHERE *any column* LIKE '%{target}%' | 149 Equivalent to SELECT * FROM {table} WHERE *any column* LIKE '%{target}%'. |
148 Useful when you don't know, don't remember, or don't care which column | 150 Useful when you don't know, don't remember, or don't care which column |
149 a value may be found in. | 151 a value may be found in. |
150 | 152 |
151 Options:: | 153 Options:: |
152 | 154 |
154 | 156 |
155 find -c {target}, find -t {column} | 157 find -c {target}, find -t {column} |
156 Lists all tables or columns whose names contain {target}. More convenient than | 158 Lists all tables or columns whose names contain {target}. More convenient than |
157 querying user_tab_columns/all_tab_columns or user_tables/all_tables. | 159 querying user_tab_columns/all_tab_columns or user_tables/all_tables. |
158 Options:: | 160 Options:: |
161 | |
159 -a Find all objects (not just my own) | 162 -a Find all objects (not just my own) |
160 | 163 |
161 PostgreSQL-like shortcuts | 164 PostgreSQL-like shortcuts |
162 ========================= | 165 ========================= |
163 | 166 |
164 ----- ------------------ | 167 psql, the command-line client for the open-source database `PostgreSQL <http://www.postgresql.org/>`_ uses a number |
165 z y | 168 of backslash-character sequences as convenient shortcuts. sqlpython steals many of |
166 ----- ------------------ | 169 them. |
170 | |
171 ===== =================== | |
167 \\c connect | 172 \\c connect |
168 \\d desc | 173 \\d desc |
169 \\e edit | 174 \\e edit |
170 \\g run | 175 \\g run |
171 \\h help | 176 \\h help |
179 \\dn _dir_schemas | 184 \\dn _dir_schemas |
180 \\dt _dir_tables | 185 \\dt _dir_tables |
181 \\dv _dir_views | 186 \\dv _dir_views |
182 \\di _dir_indexes | 187 \\di _dir_indexes |
183 \\? help psql | 188 \\? help psql |
184 ----- ------------------ | 189 ===== =================== |
185 | 190 |
186 PL/SQL source code | 191 PL/SQL source code |
187 ================== | 192 ================== |
188 | 193 |
189 pull {object_name} | 194 pull {object_name} |
201 | 206 |
202 find {target} | 207 find {target} |
203 Lists all PL/SQL objects whose source code contains the {target} string. | 208 Lists all PL/SQL objects whose source code contains the {target} string. |
204 Always case-insensitive. | 209 Always case-insensitive. |
205 Options:: | 210 Options:: |
211 | |
206 -a Search all PL/SQL objects (not just my own) | 212 -a Search all PL/SQL objects (not just my own) |
207 | 213 |
208 | 214 |
209 Bind variables | 215 Bind variables |
210 ============== | 216 ============== |
367 Parameters | 373 Parameters |
368 ========== | 374 ========== |
369 | 375 |
370 Several parameters control the behavior of sqlpython itself. | 376 Several parameters control the behavior of sqlpython itself. |
371 | 377 |
372 ===================== ================================================== =============== | 378 ===================== =================================================== =============== |
373 default | 379 parameter effect default |
374 ===================== ================================================== =============== | 380 ===================== =================================================== =============== |
375 autobind When True, single-row queries automatically `bind` False | 381 autobind When True, single-row queries automatically `bind` False |
376 commit_on_exit Automatically commits work at end of session True | 382 commit_on_exit Automatically commits work at end of session True |
377 continuation_prompt Prompt for second line and onward of long statement > | 383 continuation_prompt Prompt for second line and onward of long statement > |
378 default_file_name The file opened by `edit`, if not specified afiedt.buf | 384 default_file_name The file opened by `edit`, if not specified afiedt.buf |
379 echo Echo command entered before executing False | 385 echo Echo command entered before executing False |
380 editor Text editor invoked by `edit`. varies | 386 editor Text editor invoked by `edit`. varies |
381 heading Print column names True | 387 heading Print column names True |
382 maxfetch Maximum number of rows to return from any query 1000 | 388 maxfetch Maximum number of rows to return from any query 1000 |
383 maxtselctrows Maximum # of rows from a tselect or \\n query 10 | 389 maxtselctrows Maximum # of rows from a tselect or \\n query 10 |
384 prompt Probably unwise to change user@instance> | 390 prompt Probably unwise to change user@instance> |
385 scan Interpret & as indicating substitution variables True | 391 scan Interpret & as indicating substitution variables True |
386 serveroutput Print DBMS_OUTPUT.PUT_LINE results True | 392 serveroutput Print DBMS_OUTPUT.PUT_LINE results True |
387 sql_echo Print text of "behind-the-scenes" queries False | 393 sql_echo Print text of "behind-the-scenes" queries False |
388 timeout In seconds 30 | 394 timeout In seconds 30 |
389 timing Print time for each command to execute False | 395 timing Print time for each command to execute False |
390 wildsql Accept *, %, #, and ! in column names False | 396 wildsql Accept *, %, #, and ! in column names False |
391 ===================== ================================================== =============== | 397 ===================== =================================================== =============== |
392 | 398 |
393 The user can change these with the `set {paramname} {new-value}` statement. | 399 The user can change these with the `set {paramname} {new-value}` statement. |
394 The True/False parameters accept new | 400 The True/False parameters accept new values permissively, recognizing "True", "False", |
395 values permissively, recognizing "True", "False", "T", "F", "yes", "no", "on", "off"... | 401 "T", "F", "yes", "no", "on", "off", etc. |
396 | 402 |
397 `set` and `show` both list the current values of the sqlpython parameters. | 403 `set` and `show` both list the current values of the sqlpython parameters. They |
404 also recognize any abbreviated parameter name, so long as it is long enough to be | |
405 unique. That is, `show maxf` is recognized as `show maxfetch`, but `show max` is | |
406 too short to distinguish between `maxfetch` and `maxtselctrows`. | |
407 | |
398 `show parameter {param}` shows current Oracle parameters (from v$parameter), as it does | 408 `show parameter {param}` shows current Oracle parameters (from v$parameter), as it does |
399 in SQL\*Plus. | 409 in SQL\*Plus. |
400 | 410 |
401 Tuning | 411 Tuning |
402 ====== | 412 ====== |