queryData: Query Data SQL

Description Usage Arguments Details Author(s) See Also Examples

Description

Query data from SQL sources

Usage

1
2
3
4
5
queryData(connection = stop("'connection' must be specified"),
  table = stop("'table' must be specified"), namecou = character(),
  namevar = character(), nameeuc = character(), dim.ind = "ind",
  isic = 4, nameind = character(), nameyear = character(),
  add.where = "", topn = character())

Arguments

connection

a connection handle as returned by 'odbcConnect'.

table

an existing table or view in the database specified with ‘connection’.

namecou

a character vector of 3-digit ISO country codes read from column ‘cou’.

namevar

a character vector of variables read from column ‘var’.

nameeuc

a character vector of end-use categories read from column ‘CATEG’.

dim.ind

name of column containing the industry dimension, if different from ‘ind’.

isic

an integer specifying the ISIC classification of data sources.

nameind

a character vector of industries read from column ‘ind’ or from ‘dim.ind’ if specified.

nameyear

and integer vector specifying the selected period.

add.where

additional statements passed to the ‘WHERE’ condition of the query.

topn

extract only top N number of records.

Details

Helper function to efficiently query data from SQL sources.

Author(s)

OECD STAN

See Also

packageData, RODBC

Examples

1
2
3
4
library(RODBC)
SQL.STAN <- odbcDriverConnect(connection="SERVER=VS-GEN-SQL-3;DRIVER=SQL Server;DATABASE=STAN",
                              readOnlyOptimize = TRUE)
DATA.STAN <- queryData(connection=SQL.STAN, table="STANPUB", isic=3)

bowerth/stan documentation built on May 13, 2019, 12:38 a.m.