Go to Oracle

Source: Internet
Author: User
Tags win32

1. Download MinGW (GCC compilation)---Win32

2. Download the latest OCI version, stored in C:\instantclient_12_1---Win32

3. Download OCI SDK latest version, store in C:\INSTANTCLIENT_11_2\SDK

4. Download the relevant source code.

Configure system Environment variables: Gopath

CD to Desktop\go directory

Execute go get github.com/wendal/go-oci8

5 Modify Coi8.go File

6. Download Pkg-config.exe and OCI8.PC

(Already stored in the Windows folder,)
Copy the Pkg-config.exe to the C:\mingw\bin\
Copy the oci8.pc to the C:\mingw\lib\pkg-config\

Note that OCI8.PC needs to be modified according to the OCI you downloaded. Here are the changes I made based on the OCI version I downloaded.

# Information for Pkg-config

Prefix=c:/instantclient_12_1
Exec_prefix=c:/instantclient_12_1
Libdir=${exec_prefix}
includedir=${prefix}/sdk/include/

Name:oci
Description:oracle Database Engine
version:12.1
Libs:-l${libdir}-loci
Libs.private:
Cflags:-i${includedir}

7. Modify the system environment variables,

Add to
Path= the original path; C:\instantclient_12_1; C:\MinGW\bin;
Pkg_config_path=c:\mingw\lib\pkg-config

8. Test:


CD%gopath%/src/github.com/wendal/go-oci8/example
Go Run oracle.go

Go to Oracle

Related Article

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.