comparison docs/source/capabilities.rst @ 286:abb4c6524113

adding ioug paper
author catherine@dellzilla
date Fri, 20 Mar 2009 13:05:45 -0400
parents 80484bc60bdd
children dd7b3e4b58dd
comparison
equal deleted inserted replaced
285:316abf2191a4 286:abb4c6524113
37 The up- and down-arrow keys allow you to scroll through the lines entered so far 37 The up- and down-arrow keys allow you to scroll through the lines entered so far
38 in your sqlpython session. 38 in your sqlpython session.
39 39
40 Commands are also entered into a command history. 40 Commands are also entered into a command history.
41 41
42 `history` or `hi` 42 history *or* hi
43 List entire command history 43 List entire command history
44 44
45 `list` or `li` 45 list *or* li
46 List only last command 46 List only last command
47 47
48 `hi <N>` 48 hi `<N>`
49 List command number <N> from history. 49 List command number <N> from history.
50 50
51 `hi <N>-`, `hi -<N>` 51 hi `<N>-`, hi `-<N>`
52 List commands from <N> onward, or up to <N> 52 List commands from <N> onward, or up to <N>
53 53
54 `hi <str>` 54 hi `<str>`
55 Lists commands that include the string <str> 55 Lists commands that include the string <str>
56 56
57 `hi /<regex>/` 57 hi `/<regex>/`
58 Lists commands that match the regular expression <regex> 58 Lists commands that match the regular expression <regex>
59 59
60 `run`, `r`, or `\\g` 60 run, r, *or* `\\g`
61 Run the most recent command again 61 Run the most recent command again
62 62
63 `run <N>` 63 run `<N>`
64 Run command <N> 64 Run command <N>
65 65
66 `run <str>`, `run /<regex>/` 66 run `<str>`, run `/<regex>/`
67 Run command matching <str> or <regex> (as for `history`) - 67 Run command matching <str> or <regex> (as for `history`) -
68 if multiple items would match, run most recent 68 if multiple items would match, run most recent
69 69
70 Special I/O destinations 70 Special I/O destinations
71 ======================== 71 ========================
72 72
73 Much as in a UNIX shell, you can follow a command with a special output destination. 73 Much as in a UNIX shell, you can follow a command with a special output destination.
123 123
124 Many sqlpython commands allow you to act as though the database objects 124 Many sqlpython commands allow you to act as though the database objects
125 were files in a UNIX filesystem. Many of the commands also accept flags 125 were files in a UNIX filesystem. Many of the commands also accept flags
126 to modify their behavior. 126 to modify their behavior.
127 127
128 ls {object type/object name, with wildcards} 128 ls `{object type/object name, with wildcards}`
129 Lists objects from the data dictionaries, as though they were in a 129 Lists objects from the data dictionaries, as though they were in a
130 *object_type*/*object_name* directory structure. Thus, `ls view/\*` 130 *object_type*/*object_name* directory structure. Thus, `ls view/\*`
131 lists all the user's views. Calling with no argument is equivalent 131 lists all the user's views. Calling with no argument is equivalent
132 to `ls *`. 132 to `ls *`.
133 133
139 -r, --reverse Reverse order while sorting 139 -r, --reverse Reverse order while sorting
140 140
141 `ls -lt *;10` lists the ten items with the most recent last_ddl_time; 141 `ls -lt *;10` lists the ten items with the most recent last_ddl_time;
142 this can be a good way to answer the question, "What was I working on?" 142 this can be a good way to answer the question, "What was I working on?"
143 143
144 cat {remainder of query} 144 cat `{remainder of query}`
145 Shorthand for "SELECT * FROM". Can be combined with anything else 145 Shorthand for "SELECT * FROM". Can be combined with anything else
146 that fits into a SELECT statement (WHERE, ORDER BY, etc.) 146 that fits into a SELECT statement (WHERE, ORDER BY, etc.)
147 147
148 grep {grep {target} {table} [{table2,...}] 148 grep `{target}` `{table}` `[{table2,...}]`
149 Equivalent to SELECT * FROM {table} WHERE *any column* LIKE '%{target}%'. 149 Equivalent to SELECT * FROM {table} WHERE *any column* LIKE '%{target}%'.
150 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
151 a value may be found in. 151 a value may be found in.
152 152
153 Options:: 153 Options::
154 154
155 -i, --ignore-case Case-insensitive search 155 -i, --ignore-case Case-insensitive search
156 156
158 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
159 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.
160 Options:: 160 Options::
161 161
162 -a Find all objects (not just my own) 162 -a Find all objects (not just my own)
163
164 Data dictionary exploration
165 ===========================
166
167 refs `{table_name}`
168 Lists all foreign key constraints on the table or referring to the table.
169
170 deps `{object_name}`
171 Lists all objects dependent upon the named object.
172
173 comments `{table_name}`
174 Prints comments on a table and its columns.
175
176 PL/SQL source code
177 ==================
178
179 pull {object_name}
180 Displays the PL/SQL source code for {object_name}.
181
182 Options:
183 -d, --dump dump results to files (object_type/object_name.sql)
184 -f, --full get dependent objects as well
185 -a, --all all schemas' objects
186
187 bzr, git, hg `{object_name}`
188 Dump source code to files, as `pull -f`, but also creates or commits to a
189 repository of the appropriate distributed version control system
190 (Bazaar, Git, or Mercurial, respectively).
191
192 find `{target}`
193 Lists all PL/SQL objects whose source code contains the {target} string.
194 Always case-insensitive.
195 Options::
196
197 -a Search all PL/SQL objects (not just my own)
163 198
164 PostgreSQL-like shortcuts 199 PostgreSQL-like shortcuts
165 ========================= 200 =========================
166 201
167 psql, the command-line client for the open-source database `PostgreSQL <http://www.postgresql.org/>`_ uses a number 202 psql, the command-line client for the open-source database `PostgreSQL <http://www.postgresql.org/>`_ uses a number
185 \\dt _dir_tables 220 \\dt _dir_tables
186 \\dv _dir_views 221 \\dv _dir_views
187 \\di _dir_indexes 222 \\di _dir_indexes
188 \\? help psql 223 \\? help psql
189 ===== =================== 224 ===== ===================
190 225
191 PL/SQL source code
192 ==================
193
194 pull {object_name}
195 Displays the PL/SQL source code for {object_name}.
196
197 Options:
198 -d, --dump dump results to files (object_type/object_name.sql)
199 -f, --full get dependent objects as well
200 -a, --all all schemas' objects
201
202 bzr, git, hg {object_name}
203 Dump source code to files, as `pull -f`, but also creates or commits to a
204 repository of the appropriate distributed version control system
205 (Bazaar, Git, or Mercurial, respectively).
206
207 find {target}
208 Lists all PL/SQL objects whose source code contains the {target} string.
209 Always case-insensitive.
210 Options::
211
212 -a Search all PL/SQL objects (not just my own)
213
214
215 Bind variables 226 Bind variables
216 ============== 227 ==============
217 228
218 Bind variables work in sqlpython as they do in SQL\*Plus, but they are set dynamically; there 229 Bind variables work in sqlpython as they do in SQL\*Plus, but they are set dynamically; there
219 is no need to declare them before use. The syntax for setting them is more permissive than 230 is no need to declare them before use. The syntax for setting them is more permissive than