Deleting oracle table using RJDBC

江枫思渺然 提交于 2019-12-14 03:17:38

问题


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 

回答1:


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")


来源:https://stackoverflow.com/questions/31391221/deleting-oracle-table-using-rjdbc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!