问题
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