r - Inserting a numeric value into a where statement -


i got following code works pretty smooth:

 sql_cag <- sprintf("select * `cag_table` `comp_id` = 1");  df <- dbgetquery(con, sql_cag) 

what replace 1 parameter. this:

 sql_cag <- sprintf("select * `cag_table` `comp_id` ='%a'", competitie_id);  df <- dbgetquery(con, sql_cag) 

with parameter competitie_id

 competitie_id <- 1  competitie_id <- as.numeric(competitie_id) 

but returns empty dataframe. somehow seems go wrong '%a'. thoughts mights go wrong?


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -