One way would be
sql - scan('stmt.sql', what='')
Then
sql - paste(sql, collapse=' ')
or
sql - paste(sql, collapse='\n')
After which you can check with
cat(sql, '\n')
I do this sort of thing when I want to maintain an SQL template in an
external file, then modify it in R before using one
Thanks a lot. The hint with readLines worked :)
Then I got it to work like this:
sql - paste(readLines(con = stmnt.sql), collapse = )
result - sqlQuery(db,sql)
Michel
2014-03-02 17:52 GMT+01:00 Gabor Grothendieck ggrothendi...@gmail.com:
On Fri, Feb 28, 2014 at 5:16 AM, Streng Ge-heim
On 14-03-02 8:06 AM, normannus wrote:
Am 28.02.2014 20:54, schrieb Duncan Murdoch:
On 28/02/2014 5:16 AM, Streng Ge-heim wrote:
Hi,
first of all: I am new to R. Anyway, I would like to include sql
files in
my r-script, which I load via source(scriptname) in the CLI.
The sql files (i.e.
Am 28.02.2014 20:54, schrieb Duncan Murdoch:
On 28/02/2014 5:16 AM, Streng Ge-heim wrote:
Hi,
first of all: I am new to R. Anyway, I would like to include sql
files in
my r-script, which I load via source(scriptname) in the CLI.
The sql files (i.e. stmt.sql) contains select statements with
R does not require the begin and end quote marks for string literals to be on
the same line. There is nothing preventing you from formatting your SQL to your
preference right in within R code.
---
Jeff Newmiller
Hi,
first of all: I am new to R. Anyway, I would like to include sql files in
my r-script, which I load via source(scriptname) in the CLI.
The sql files (i.e. stmt.sql) contains select statements with joins, line
breaks, various characters, they can be quite long.
My question is, is there a way
On 28/02/2014 5:16 AM, Streng Ge-heim wrote:
Hi,
first of all: I am new to R. Anyway, I would like to include sql files in
my r-script, which I load via source(scriptname) in the CLI.
The sql files (i.e. stmt.sql) contains select statements with joins, line
breaks, various characters, they can
7 matches
Mail list logo