找回密码
 注册
查看: 1289|回复: 0

R语言 ROracle包 Oracle()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-27 23:26:44 | 显示全部楼层 |阅读模式
Oracle(ROracle)
Oracle()所属R语言包:ROracle

                                         Instantiate an Oracle client from the current <font face="Courier New,Courier" color="#666666"><b>R</b></font> session
                                         从目前的Oracle客户端实例<font face="Courier New,Courier" color="#666666"> <B> R </ B> </ FONT>会话

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

This function creates and initializes an Oracle client from the current R session. It returns an object that allows you to connect to one or several Oracle servers.
这个函数创建并初始化一个Oracle客户端从目前的R会话。它返回一个对象,它允许您连接到一个或多个Oracle服务器。


用法----------Usage----------


  Oracle(interruptible = FALSE)



参数----------Arguments----------

参数:interruptible
logical indicating whether to allow user interrupts on long-running queries.  
逻辑指示是否允许用户中断长时间运行的查询。


Details

详细信息----------Details----------

This object is a singleton, that is, on subsequent invocations it returns the same initialized object.
此对象是单身,那就是,在随后的调用返回相同的初始化的对象。

This implementation allows you to connect to multiple host servers and run multiple connections on each server simultaneously.
该实现连接多台主机服务器,在每台服务器上同时运行多个连接。

When interruptible is set to TRUE, it allows for interrupting long-running queries on the server by executing the query in a thread. Main thread checks for Ctrl-C and issues OCIBreak/OCIReset to cancel the operation on the server. By default interruptible is FALSE.
中断设置为TRUE时,它允许中断长时间运行的查询服务器上的一个线程中执行查询。主线程为Ctrl-C和的问题OCIBreak /取消对服务器的操作OCIReset的的检查。默认情况下,中断是FALSE。


值----------Value----------

An object OraDriver whose class extends DBIDriver. This object is used to create connections, using the function dbConnect, to one or several Oracle database engines.
对象OraDriver的类扩展DBIDriver。该对象用于创建连接,使用功能dbConnect,一个或多个Oracle数据库引擎。


副作用----------Side Effects----------

The R client part of the database communication is initialized, but note that connecting to the database engine needs to be done through calls to dbConnect.
R客户端的数据库通信初始化,但需要注意的是需要连接到数据库引擎通过调用dbConnect完成。


Oracle用户身份验证----------Oracle user authentication----------

In order to establish a connection to an Oracle server users need to provide a user name, a password, and possibly a connect identifier (for more informations refer to chapter 8 (Configuring Naming Methods) of Oracle Database Net Services Administrator's Guide). This is the same as part of the SQL*Plus connect string that follows the '@' sign.
为了建立一个连接到Oracle服务器的用户需要提供用户名,密码,以及可能的连接标识符(更详细的信息,请参阅第8章(配置命名方法)的Oracle数据库网络服务管理员指南)。这是相同的SQL * Plus的连接字符串后面的“@”符号。

Connections to an Oracle TimesTen IMDB instance are established using the OCI tnsnames or easy connect naming methods. For additional information on  TimesTen connections for OCI see chapter 3  (TimesTen Support for Oracle Call Interface) of the Oracle TimesTen In-Memory C Developer's Guide.
建立保险业监理处的TNSNAMES或轻松连接命名方法连接到Oracle的TimesTen IMDB实例。保险业监理处对TimesTen的连接为更多的信息,请参阅第3章(TimesTen的支持Oracle调用接口)的Oracle TimesTen内存中的C语言开发的指南。


交易----------Transactions----------

The current implementation directly supports transaction commits and rollbacks on a connection-wide basis through calls to dbCommit and dbRollback. Save points are not yet directly implemented, but you may be able to define them and rollback to them through calls to dynamic SQL with dbGetQuery.
目前的实现直接支持事务提交和回滚一个连接范围内的基础上,通过调用dbCommit和dbRollback。保存点尚未直接实现,但你可以对它们进行定义并回滚到它们通过调用动态SQL dbGetQuery。

Notice that Oracle (and ANSI/ISO compliant DBMS) transactions are  implicitly started when data definition SQL are executed (create table, etc.), which helper functions like dbWriteTable may execute behind the scenes. You may want or need to commit or roll back your work before issuing any of these helper functions.
请注意,甲骨文公司(ANSI / ISO标准的DBMS)的交易被隐式开始时执行SQL的数据定义(创建表,等),辅助功能,如dbWriteTable可以执行的幕后。您可能希望或需要提交或回滚你的工作,然后再发出任何这些辅助功能。


参考文献----------References----------

http://www.oracle.com/technetwork/indexes/documentation/index.html.

(作者)----------Author(s)----------

David A. James and Denis Mukhin



参见----------See Also----------

On database managers:
在数据库管理器:

dbDriver dbUnloadDriver dbListConnections
dbDriverdbUnloadDriverdbListConnections

On connections:
在连接:

dbConnect dbDisconnect dbSendQuery dbGetQuery dbGetException dbListResults
dbConnectdbDisconnectdbSendQuerydbGetQuerydbGetExceptiondbListResults

Convenience methods: dbListTables dbReadTable dbWriteTable dbExistsTable dbRemoveTable dbListFields
方便的方法:dbListTablesdbReadTabledbWriteTabledbExistsTabledbRemoveTabledbListFields

On transaction management:
事务管理:

dbCommit dbRollback
dbCommitdbRollback

On queries and result objects:
在查询结果对象:

fetch dbClearResult dbColumnInfo dbGetStatement dbHasCompleted dbGetRowsAffected dbGetRowCount
fetchdbClearResultdbColumnInfodbGetStatementdbHasCompleteddbGetRowsAffecteddbGetRowCount

On meta-data:
在元数据:

show summary dbGetInfo
showsummarydbGetInfo


实例----------Examples----------


  ## Not run: [#不运行:]
    ## create a Oracle instance and create one connection.[#创建一个Oracle实例,并创建一个连接。]
    ora &lt;- Oracle()         ## or dbDriver("Oracle")[(#或dbDriver的“甲骨文”)]
    con <- dbConnect(ora, username = "scott", password = "tiger",
                     dbname = "inst1")

    ## if you are connecting to a local database[#如果你要连接到一个本地数据库]
    con <- dbConnect(ora, username = "scott", password = "tiger")

    ## execute a statement and fetch its output in chunks of no more[#执行语句,获取其输出没有更多的块]
    ## than 5000 rows at a time[#超过5000行的时间]
    rs   <- dbSendQuery(con, "select * from emp where deptno = 10")
    while (!dbHasCompleted(rs)) {
      df <- fetch(rs, n = 5000)
      ## process df[#程序DF]
    }
    dbClearResult(rs)       ## done with this query[#做这个查询]

    ## execute and fetch a statement with bind data[#执行,并获取一份声明中的数据绑定]
    df <- dbGetQuery(con, "select * from emp where deptno = :1",
                     data = data.frame(depno = 10))

    ## create a copy of emp table[#创建emp表的副本]
    dbGetQuery(con, "create table foo as select * from emp")

    ## execute and bind an INSERT statement[#执行和绑定一个INSERT语句]
    my.data = data.frame(empno = c(8001, 8002), ename = c('MUKHIN', 'ABOYOUN'))
    more.data = data.frame(empno = c(8003), ename = c('JAMES'))
    rs <- dbSendQuery(con, "insert into foo (empno, ename) values (:1, :2)",
                      data = my.data)

    ## execute with more data[#执行更多的数据]
    execute(rs, data = more.data)
    dbClearResult(rs)       ## done with this query[#做这个查询]

    ## ok, everything looks fine[#OK,一切都看起来不错]
    dbCommit(con)           

    ## a concise description of the driver [#驱动程序的简要说明]
    summary(ora)

    ## done with this connection[#做这方面]
    dbDisconnect(con)
  
## End(Not run)[#(不执行)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-25 20:20 , Processed in 0.033943 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表