Skip to content
Prev 258893 / 398502 Next

tryCatch?

Start with try(): you may find it easier to understand.

if(inherits(try(<call1>), "try-error")) <call2>

so in your case

if(inherits(try(sqlSave(pg, tbl[i, ], "tbl", append = TRUE,
                         rownames = FALSE))))
     sqlUpdate(pg, tbl[i, ], index = "key")

or some such.
On Wed, 4 May 2011, Mikkel Grum wrote: