Hello. I am trying to create a new table as the union of two existing tables via an R DBI connection, but am receiving an error message that I cannot seem to fix.  Any advice to help correct the syntax would be greatly appreciated.


> dbGetQuery(mdb,
"CREATE TABLE nis_0411 AS 
Select * FROM nis_0407
UNION ALL
Select * FROM is_0811")


Error in .local(conn, statement, ...) : 
  Unable to execute statement 'CREATE TABLE nis_0411 AS 
Select * FROM nis_0407
UNION ALL
Select * FROM nis_0811'.
Server says 'syntax error, unexpected SCOLON, expecting WITH in: "create table nis_0411 as 
select * from nis_0407
union all
select * from nis_"
' [#42000].

Cheers

Charles


Charles DiMaggio, PhD, MPH
Director of Injury Research
Department of Surgery
New York University School of Medicine
462 First Avenue, NBV 15
New York, NY 10016-9196
Direct Line: 516.308.6426 (preferred)
Office: 212.263.3202