使用RJDBC删除Oracle表 [英] Deleting oracle table using RJDBC
本文介绍了使用RJDBC删除Oracle表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种使用oracle函数在R中删除(截断)表的方法?我正在使用JDBC连接到oracle;我想截断内容,然后将新数据加载到表中.
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.
例如:
select employee_info into variable_name;
这将执行功能并将NULL
(如果成功)或error_message
加载到variable_name
.下一步…检查variable_name
的内容.如果为NULL
,则继续插入.
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
推荐答案
是.您可以在Oracle中执行:
Yes. You can execute in Oracle:
TRUNCATE TABLE employee_info
我不知道R,但是应该是:
I don't know R but it's should be:
dbGetQuery(conn, "TRUNCATE TABLE employee_info")
这篇关于使用RJDBC删除Oracle表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文