2004³â 06¿ù 19ÀÏ

pyPgSQL »ç¿ë¹ý

Posted in Linux at 02:56:13 by ´ÙÁñ¸µ

>>> from pyPgSQL import PgSQL
>>> cx = PgSQL.connect(database='esi')
>>> cu = cx.cursor()
>>> cu.callproc('mmYearInfo')
>>> rs = cu.fetchone()
>>> rs
[<pyPgSQL.PgSQL.Cursor instance at 0x818495c>]
>>> c = rs[0]
>>> for i in c.description:
...     print i
...
['model_year', varchar, 4, 8, None, None, None, 0]
['mktg_div_name', varchar, 50, 54, None, None, None, 0]
['model_desc', varchar, 50, 54, None, None, None, 0]
['book_types', varchar, 50, 54, None, None, None, 0]
['vehicle_syskey', integer, 4, 4, None, None, None, 0]
>>> r = c.fetchone()
>>> r
['2003', 'Buick', 'Century', '1;8;9', 2211]
>>>

Leave a Comment

Don't write Name and comment in english
I'll not accept only english comment
if you want to write in english
add "@" before your name like.. @KwonHanBae