dbReadTable-methods(RMySQL)
dbReadTable-methods()所属R语言包:RMySQL
Convenience functions for Importing/Exporting DBMS tables
便利DBMS表的导入/导出功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These functions mimic their R/S-Plus counterpart get, assign, exists, remove, and objects, except that they generate code that gets remotely executed in a database engine.
这些功能模仿他们的R / S-PLUS对应get,assign,exists,remove和objects,除了他们所产生的代码被远程执行在一个数据库引擎。
值----------Value----------
A data.frame in the case of dbReadTable; otherwise a logical indicating whether the operation was successful.
Adata.frame的情况下,dbReadTable,否则逻辑指示操作是否成功。
方法----------Methods----------
注意----------Note----------
Note that data.frames are only approximately analogous to tables (relations) in relational DBMS, and thus you should not expect complete agreement in their semantics. Tables in RDBMS are best thought of as relations with a number of constraints imposed by the relational database model, and data.frames, with their roots in statistical modeling, as self-contained "sequence of observations on some chosen variables" (Chambers and Hastie (1992), p.46). In particular the data.frame returned by dbReadTable only has primitive data, e.g., it does not coerce character data to factors. Also, column names in a data.frame are not guaranteed to be equal to the column names in a MySQL exported/imported table (e.g., by default MySQL reserved identifiers may not be used as column names — and with 218 keywords like "BEFORE", "DESC", and "FROM" the likelihood of name conflicts is not small.) Use isSQLKeyword(con, names(value)) to check whether the data.frame names in value coincide with MySQL reserver words.
需要注意的是的data.frames只有大约类似于在关系型DBMS表(关系),因此,你不应该指望在语义完全一致。 RDBMS中的表最好的思想与关系数据库模型的一些限制,data.frames的关系,他们的根在统计建模为一个独立的“序列观察一些选择的变量”(Chambers和黑斯蒂(1992年),第46页)。尤其是data.frame返回dbReadTable只有原始数据,例如,它不强迫字符数据的因素。此外,在数据框的列名不保证等于一个MySQL表导出/导入(例如,默认情况下,MySQL保留标识符中的列名,列名不得使用 - 和218等关键字"BEFORE","DESC"和"FROM"名称冲突的可能性是不小的。)使用isSQLKeyword(con, names(value))中的数据框名称,以检查是否value与MySQL的贮库的话。
MySQL table names are not case sensitive, e.g., table names ABC and abc are considered equal.
MySQL的表名是大小写不敏感,例如,表名ABC和abc被认为是相等的。
参考文献----------References----------
<code>DBI.pdf</code> in the base directory of this package or http://stat.bell-labs.com/RS-DBI.
参见----------See Also----------
MySQL, mysqlImportFile, isSQLKeyword, dbDriver, dbConnect, dbSendQuery, dbGetQuery, fetch, dbCommit, dbGetInfo, dbListTables, dbReadTable.
MySQL,mysqlImportFile,isSQLKeyword,dbDriver,dbConnect,dbSendQuery,dbGetQuery,fetch,dbCommit,dbGetInfo,dbListTables,dbReadTable。
实例----------Examples----------
conn <- dbConnect("MySQL", group = "wireless")
if(dbExistsTable(con, "fuel_frame")){
dbRemoveTable(conn, "fuel_frame")
dbWriteTable(conn, "fuel_frame", fuel.frame)
}
if(dbExistsTable(conn, "RESULTS")){
dbWriteTable(conn, "RESULTS", results2000, append = T)
else
dbWriteTable(conn, "RESULTS", results2000)
}
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|