Open Source RDBMS - Seamless, Scalable, Stable and Free

English | Login |Register

Executing a SELECT query with CUBRID Python driver


Here is a simple Python program which executes a SELECT query against a demodb database installed on a localhost.

import CUBRIDdb
conn = CUBRIDdb.connect('CUBRID:localhost:33000:demodb:::', 'dba', '')
cur = conn.cursor()

cur.execute('SELECT * FROM code')

rows = cur.fetchall()
for row in rows:
    print row

cur.close()
conn.close()

To run this program, copy and paste it to a file (eg. cubrid_example.py), then execute the following command:

$ python cubrid_example.py

comments powered by Disqus
문서 정보
viewed 784 times
번역 en
작성자
posted 작년
CUBRID
공헌자
마지막 수정시간 작년
변경 내역 보기
Share this article