R Connecting the DB2 database

Source: Internet
Author: User
Tags db2 db2 driver dsn odbc
1.ODBC File Download Http://dasapp.oregon.gov/datamart/files/IBM_DB2_9.7_Run_Time_client_Notes.pdf Open:/http dasapp.oregon.gov/datamart/Download the driver and install it. Configure ODBC, just start by tutorial, in ODBC did not find DB2 driver behind in C:\Windows\SysWOW64 search ODBC, find this: open and follow the tutorial configuration. Configuration also reference: HTTP://XUJINGLI88.BLOG.163.COM/BLOG/STATIC/411786192009324294164/2. Connect db2> Library (RODBC) > conn = Odbcconnect (dsn= "DB2", uid= "Tjfx", "1") #刚开始在64位R下, reported this error: is version incompatibility caused, I fear trouble, directly to the Rstudio changed to 32-bit: Click Tools--Global Options--Modify R version 3. Query http://www.ibm.com/developerworks/data/library/techarticle/dm-1402db2andr/#listing6 Library (RODBC) conn = Odbcconnect (dsn= "DB2", uid= "Tjfx", "1") #把表中的数据存到内存res <-SqlFetch (conn, "Etlusr". Ecs_brand ") #查询, but cannot be queried across tables SQLQuery (conn, paste (' select ' brand_id ', ' brand_name ' from ' Dim_ecs_goods_brand ', ' where ' brand_id "<100 ORDER by" brand_id "))

R Connecting the DB2 database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.