<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>jinc_seol.log</title>
        <link>https://velog.io/</link>
        <description>DO</description>
        <lastBuildDate>Fri, 24 Sep 2021 08:40:02 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>jinc_seol.log</title>
            <url>https://images.velog.io/images/jinc_seol/profile/bd2bfd23-6fa4-4e23-8d7d-17c190363c90/social.png</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. jinc_seol.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/jinc_seol" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[파이썬과 오라클 연결하기]]></title>
            <link>https://velog.io/@jinc_seol/%ED%8C%8C%EC%9D%B4%EC%8D%AC%EA%B3%BC-%EC%98%A4%EB%9D%BC%ED%81%B4-%EC%97%B0%EA%B2%B0%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@jinc_seol/%ED%8C%8C%EC%9D%B4%EC%8D%AC%EA%B3%BC-%EC%98%A4%EB%9D%BC%ED%81%B4-%EC%97%B0%EA%B2%B0%ED%95%98%EA%B8%B0</guid>
            <pubDate>Fri, 24 Sep 2021 08:40:02 GMT</pubDate>
            <description><![CDATA[<ol>
<li><p>파이썬 설치</p>
</li>
<li><p>오라클 설치</p>
</li>
<li><p>cx_Oracle 라이브러리 설치</p>
</li>
</ol>
<p>관리자 권한으로 실행한 Anaconda Prompt창에서 하단의 명령어 입력
python -m pip install cx_Oracle --upgrade</p>
<p>문서정보 
<a href="https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html">https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html</a></p>
<ol start="4">
<li>instant-client 설치
오라클 버전에 맞춰서 다운로드 필요함.
<a href="http://www.oracle.com/database/technologies/instant-client/downloads.html">www.oracle.com/database/technologies/instant-client/downloads.html</a></li>
</ol>
<ol start="5">
<li>PATH 설정</li>
</ol>
<p>import cx_Oracle
import os</p>
<p>LOCATION = r&quot;C:\instantclient_11_2&quot;
os.environ[&quot;PATH&quot;] = LOCATION + &quot;;&quot; + os.environ[&quot;PATH&quot;] #환경변수 등록</p>
<ol start="6">
<li>연결하기</li>
</ol>
<p>connection = cx_Oracle.connect(&quot;사용자이름&quot;, &quot;비밀번호&quot;, &quot;호스트이름:포트/서비스이름&quot;)
cursor = connection.cursor()</p>
<ol start="7">
<li>데이터 불러오기</li>
</ol>
<p>cursor.execute(&quot;select * from dual&quot;)</p>
<p>for i in cursor:
print(i)</p>
<p>#DataFrame으로 확인하기 (pandas 의 read_sql 활용)
df=pd.read_sql(&quot;&quot;&quot; [쿼리 입력 부분] &quot;&quot;&quot; , con = connection)</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[오라클 버전 확인 쿼리]]></title>
            <link>https://velog.io/@jinc_seol/%EC%98%A4%EB%9D%BC%ED%81%B4-%EB%B2%84%EC%A0%84-%ED%99%95%EC%9D%B8-%EC%BF%BC%EB%A6%AC</link>
            <guid>https://velog.io/@jinc_seol/%EC%98%A4%EB%9D%BC%ED%81%B4-%EB%B2%84%EC%A0%84-%ED%99%95%EC%9D%B8-%EC%BF%BC%EB%A6%AC</guid>
            <pubDate>Fri, 24 Sep 2021 04:49:38 GMT</pubDate>
            <description><![CDATA[<p>SELECT * FROM PRODUCT_COMPONENT_VERSION;</p>
]]></description>
        </item>
    </channel>
</rss>