Description Usage Arguments Value Warning Reference See Also Examples
View source: R/get_anything_sql.R
Extract any information from any database. This function is for people who know sql and understand the database well enough to write their own sql statements. For all others, please use other functions in package
1 | get_anything_sql(channel, sqlStatement)
|
channel |
an RODBC object (see |
sqlStatement |
an sql statement |
A list is returned:
- data
containing the result of the executed sqlStatement
and
- sql
containing the sqlStatement
itself
- colNames
a vector of the table's column names
There is no default sql statement.
You will need to obtain read only privilages to access any of the databases Some of the databases contains many million records. If you try to pull the entire database it is likely you will run out of memory.
Use the data dictionary (http://nova.nefsc.noaa.gov/datadict/) for field name explanations
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# extracts silver hake (072) in area stratum (01010) for year 2001
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
sqlStatement <- "select cruise6, stratum, tow, station, length, indwt,sex from svdbs.union_fscs_svbio
where (svspp in 72) and (stratum in 01010) and (cruise6 like '2001%');"
get_anything_sql(channel,sqlStatement)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.