Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | 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
Page info
viewed 925 times
translations en
Author
posted last year by
CUBRID
Contributors
updated last year by
View revisions
Share this article