[R] RODBC query on one line

2004-09-01 Thread Mikkel Grum
Dear R-helpers,

When I use sqlQuery in the package RODBC, I cannot
break the line, but have to write the entire SQL Query
on the same line.  Is this expected behaviour? It is
definitely workable, but makes the queries a slightly
difficult to read and edit.

I'm using R 1.9.1 and RODBC 1.0-4 on Windows Server
2003 and querying a Sybase database.

Best wishes,
Mikkel

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] RODBC query on one line

2004-09-01 Thread Prof Brian Ripley
Not true: you have to submit the query as one element of a character
vector, not the same thing at all.  You *can* use paste() to assemble it.

On Wed, 1 Sep 2004, Mikkel Grum wrote:

 Dear R-helpers,
 
 When I use sqlQuery in the package RODBC, I cannot
 break the line, but have to write the entire SQL Query
 on the same line.  Is this expected behaviour? It is
 definitely workable, but makes the queries a slightly
 difficult to read and edit.
 
 I'm using R 1.9.1 and RODBC 1.0-4 on Windows Server
 2003 and querying a Sybase database.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] RODBC query on one line

2004-09-01 Thread Sean Davis
I often use paste to build up SQL queries into line-sized chunks, but 
this is only a convenience and not required.  It does improve 
readability and maintainability, in my opinion.

Sean
On Sep 1, 2004, at 5:09 AM, Mikkel Grum wrote:
Dear R-helpers,
When I use sqlQuery in the package RODBC, I cannot
break the line, but have to write the entire SQL Query
on the same line.  Is this expected behaviour? It is
definitely workable, but makes the queries a slightly
difficult to read and edit.
I'm using R 1.9.1 and RODBC 1.0-4 on Windows Server
2003 and querying a Sybase database.
Best wishes,
Mikkel
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] RODBC query on one line

2004-09-01 Thread Mikkel Grum
Thanks Brian and Sean,

Works well and solves another problem I had: changing
the same condition in a series of related but
different queries, by making only one change in a
variable that is then used in all the queries.

Mikkel

--- Sean Davis [EMAIL PROTECTED] wrote:

 I often use paste to build up SQL queries into
 line-sized chunks, but 
 this is only a convenience and not required.  It
 does improve 
 readability and maintainability, in my opinion.
 
 Sean
 
 On Sep 1, 2004, at 5:09 AM, Mikkel Grum wrote:
 
  Dear R-helpers,
 
  When I use sqlQuery in the package RODBC, I cannot
  break the line, but have to write the entire SQL
 Query
  on the same line.  Is this expected behaviour? It
 is
  definitely workable, but makes the queries a
 slightly
  difficult to read and edit.
 
  I'm using R 1.9.1 and RODBC 1.0-4 on Windows
 Server
  2003 and querying a Sybase database.
 
  Best wishes,
  Mikkel
 
  __
  [EMAIL PROTECTED] mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html