0

Is there a way to delete (truncate) a table in R using oracle function? I am using JDBC to connect to oracle; I would like truncate the contents and then load new data into the table.

For instance:

select employee_info into variable_name;

This will execute the function and load NULL (if successful) or error_message into variable_name. Next step…check contents of variable_name. If NULL, proceed with insert.

If variable_name IS NULL THEN
     INSERT INTO 
joran
  • 169,992
  • 32
  • 429
  • 468

1 Answers1

0

Yes. You can execute in Oracle:

TRUNCATE TABLE employee_info

I don't know R but it's should be:

dbGetQuery(conn, "TRUNCATE TABLE employee_info")
Zed
  • 41
  • 3