PSQLQueryTool Glossary
From DavinciWiki
(Difference between revisions)
(layout procedure contents) |
(working on procedure) |
||
Line 21: | Line 21: | ||
}} | }} | ||
{{DavinciWiki_FunctionBox|Procedure| | {{DavinciWiki_FunctionBox|Procedure| | ||
− | * Use the following commands | + | * Use the following commands in each of the following examples |
− | + | # Write the query; for more information see [[Writing_PSQL_DB_Queries|Writing PSQL-DB Queries]] | |
− | dv>query=" | + | # Access the PSQLQueryTool from Davinci; see the function page for a complete description of all available options |
− | + | # Read in the results using one of the two options shown here: | |
+ | #: "read_lines" is better for queries that return fewer lines | ||
+ | #: "copy" is better for queries that return hundreds of lines or verbose fields | ||
+ | dv>query="select table_name, field_name, description from glossary where schema_name='thmpub' order by table_name, field_name;" | ||
+ | |||
dv>url=themis3db(query,psql=1,header=1) | dv>url=themis3db(query,psql=1,header=1) | ||
− | ... | + | Using PSQL password from: /themis/lib/dav_lib/dbpass/THM_DB_USER_davinci |
− | dv>gloss=read_lines( | + | Read TEXT file: 1 lines |
− | .. | + | make this a link! http... |
+ | |||
+ | dv>gloss=read_lines(url) | ||
+ | Downloading.done. | ||
+ | Read TEXT file: 0 lines | ||
+ | Text Buffer with 0 lines of text | ||
--OR-- | --OR-- | ||
− | dv>copy( | + | dv>copy(url,$TMPDIR) |
− | + | Downloading.done. | |
+ | [path to file repeated to screen] | ||
* Example-1: Get a list of available tables | * Example-1: Get a list of available tables | ||
Line 47: | Line 57: | ||
<div style="border:0; margin:0.2em; margin-top:-.8em" valign="top"> | <div style="border:0; margin:0.2em; margin-top:-.8em" valign="top"> | ||
{{DavinciWiki_MiniNavBar}} | {{DavinciWiki_MiniNavBar}} | ||
− | {{DavinciWiki_FunctionIfBox|Functions Used| | + | {{DavinciWiki_FunctionIfBox|Functions Used| |
− | {{DavinciWiki_FunctionIfBox|Related Procedures| | + | * [[copy]] |
+ | * [[read_lines]] | ||
+ | * [[themis3db]] | ||
+ | }} | ||
+ | {{DavinciWiki_FunctionIfBox|Related Procedures| | ||
+ | * [[Writing_PSQL_DB_Queries|Writing PSQL-DB Queries]] | ||
+ | }} | ||
</div></div> | </div></div> | ||
|} | |} | ||
+ | [[category:Procedures]] | ||
+ | [[category:THEMIS_Science]] |
Revision as of 10:36, 8 April 2014
Contents: Description, Procedure
Description In order to make the most of the MSFF PSQL Mars database, you must be familiar with the schema and table layout of the database. The examples, provided here allow you to access the descriptions of the tables and columns available for you to use in your queries. There are two sources for this information in the reference schema:
The examples provided below are intended to get you started; however, you should refine the constraints-list and the order-by-list according to your needs.
Procedure
dv>query="select table_name, field_name, description from glossary where schema_name='thmpub' order by table_name, field_name;" dv>url=themis3db(query,psql=1,header=1) Using PSQL password from: /themis/lib/dav_lib/dbpass/THM_DB_USER_davinci Read TEXT file: 1 lines make this a link! http... dv>gloss=read_lines(url) Downloading.done. Read TEXT file: 0 lines Text Buffer with 0 lines of text --OR-- dv>copy(url,$TMPDIR) Downloading.done. [path to file repeated to screen]
dv> commands here dv results ...
dv> commands here dv results ...
dv> commands here dv results ... |
DavinciWiki Mini-Nav Bar Contents
Contact Developers
All other topics
Functions Used
Related Procedures |