Open Daniel-Zhou-93 opened 1 year ago
Thanks. Are you trying to copy data within the same database, or from one database into another? For the former, can you try INSERT INTO ... SELECT ... FROM ...
as a single SQL statement? The dplyr::rows_append()
function might also be useful.
Thanks. Are you trying to copy data within the same database, or from one database into another?
I need to pull data a, b, c
from mytable
and insert a, f(b,c)
into second_table
, where f
is a function that takes b
and c
as arguments. (Here, f(b, c) = b + c
for simplicity, but my actual use case involves a Haversine distance function, among other things.)
Got you. So it's difficult to compute f(b, c)
on the database.
That's a use case I haven't encountered so far. The restriction to a single result set is somewhat artificial, we might want to lift that. Would it be feasible to read the whole data as a data frame and to write the resulting data as a whole too?
I'm trying to process the entries of one table and insert the results into another table. The processing works and the rows are inserted, but the pipeline stops after the first loop with "Error: Invalid result set".
The
traceback()
traces back to:3: result_has_completed(res@ptr) 2: dbHasCompleted(rs) 1: dbHasCompleted(rs)
dbHasCompleted()
works fine on its own, but when I add theINSERT
statement, I end up with this error. However, I need to process the rows from mytable and insert them into second_table. If this isn't the way to do it, how would I go about doing this?Thank you for your help in advance.