Oracle writes an explanation of saving data into Oracle after determining whether the content is weather.

Source: Internet
Author: User

Oracle writes an explanation of saving data into Oracle after determining whether the content is weather.

At the beginning of writing a program, I wrote an order processing system. All kinds of warehouse receiving, warehouse picking, order tracking, Waybill tracking, and product mounting and dismounting were completed using MySQL, and I felt that there was no difficulty, after installing the api, you can use it. Recently, you have written a record to store data in Oracle after determining whether the content is weather. The Oracle operation process is worth recording.

I use python to operate Oracle. Therefore, I need to install the dependent package cx_Oracle. Here, I use pip to install it:

pip instll cx_Oracle

After installing the package, you still have to install a dependency package. Otherwise, the following error will be reported:

DPI-1047: 64-bit Oracle Client library cannot be loaded: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help

Click the website where the error message is displayed and select the software to download. For linux, you only need to download the instantclient, and then install the dependency and configuration variables as prompted on the webpage. For windows, you need to install the compiling environment, different instantclient versions correspond to different compilation packages. Read carefully during download,

The python operation connection data is as follows:

Method 1:

import cx_Oracle as codb = co.connect('username', 'password', 'ip:1521/database')

Method 2:

import cx_Oracle as codb = co.connect('username/password@ip:1521/database')

Method 3:

import cx_Oracle as cotns = co.makedsn('ip', 1521, 'database')db = co.connect('username', 'password', tns)

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.