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

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -