Here is the way I usually write my SQL:
> x <- c('
+ select comm, count(*) -- count the number of comms
+from myDF-- this is the dataframe
+group by comm -- grouping argument
+ ')
> x # as vector
[1] "\nselect comm, count(*) -- count the number of comms\n from
myDF-- this i
On Feb 21, 2011, at 6:14 PM, Phil Spector wrote:
Mai -
sql=c("-- This is a comment line",
+ "select sysdate -- This is a comment Text" ,
+ " from dual ")
use = sub('--.*$','',sql)
use[use != '']
[1] "select sysdate " " from dual "
Although to get it to print the way yo
Mai -
sql=c("-- This is a comment line",
+ "select sysdate -- This is a comment Text" ,
+ " from dual ")
use = sub('--.*$','',sql)
use[use != '']
[1] "select sysdate " " from dual "
Although to get it to print the way you listed, you need
to reduce the width of the line:
Hi,
I tried to remove the text starts by "--" to the end of the line as below
sql=c("-- This is a comment line",
"select sysdate -- This is a comment Text" ,
" from dual ")
>sql
[1] "-- This is a comment line"
[2] "select sysdate -- This is a comment Text"
[3] " from dual "
4 matches
Mail list logo