プライマリ・コンテンツに移動
Oracle® R Enterpriseユーザーズ・ガイド
リリース1.5
E67082-02
目次へ移動
目次
索引へ移動
索引

前
前へ
次
次へ

2.2.4 データベース表の作成および削除

ore.create関数を使用して、Oracle Databaseスキーマに永続表を作成できます。表を作成すると、データベース・スキーマを表すR環境に表のore.frameプロキシ・オブジェクトが自動的に作成されます。プロキシore.frameオブジェクトには表と同じ名前が付けられます。ore.drop関数を使用して、Oracle Databaseスキーマの永続表を削除できます。

注意:

ore.drop関数は、データベース表およびそれに関連付けられたore.frameプロキシ・オブジェクトを削除する場合にのみ使用します。永続データベース表と関連付けられてないore.frameオブジェクトを削除する場合は、これを使用しないでください。一時データベース表のore.frameオブジェクトを削除する場合は、ore.rm関数を使用します。

例2-17 表を作成および削除するためのore.createおよびore.dropの使用方法

この例では、データベース内に表を作成し、それらの一部を削除します。

# Create the AIRQUALITY table from the data.frame for the airquality data set.
ore.create(airquality, table = "AIRQUALITY")
# Create data.frame objects.
df1 <- data.frame(x1 = 1:5, y1 = letters[1:5])
df2 <- data.frame(x2 = 5:1, y2 = letters[11:15])
# Create the DF1 and DF2 tables from the data.frame objects.
ore.create(df1, "DF1")
ore.create(df2, "DF2")
# Create the CARS93 table from the data.frame for the Cars93 data set.
ore.create(Cars93, table = "CARS93")
# List the Oracle R Enterprise proxy objects.
ore.ls()
# Drop the CARS93 object.
ore.drop(table = "CARS93")
# List the Oracle R Enterprise proxy objects again.
ore.ls()
例2-17のリスト
R> # Create the AIRQUALITY table from the data.frame for the airquality data set.
R> ore.create(airquality, table = "AIRQUALITY")
R> # Create data.frame objects.
R> df1 <- data.frame(x1 = 1:5, y1 = letters[1:5])
R> df2 <- data.frame(x2 = 5:1, y2 = letters[11:15])
R> # Create the DF1_TABLE and DF2_TABLE tables from the data.frame objects.
R> ore.create(df1, "DF1")
R> ore.create(df2, "DF2")
R> # Create the CARS93 table from the data.frame for the Cars93 data set.
R> ore.create(Cars93, table = "CARS93")
R> # List the Oracle R Enterprise proxy objects.
R> ore.ls()
[1] "AIRQUALITY"  "CARS93"  "DF1"  "DF2_"
R> # Drop the CARS93 object.
R> ore.drop(table = "CARS93")
R> # List the Oracle R Enterprise proxy objects again.
R> ore.ls()
[1] "AIRQUALITY"  "DF1_"  "DF2"