imports LIST/SET/MULTISET data. To use this function.
data:tuple object
type:Element type of set,default type:string.
Example::
from CUBRIDdb import FIELD_TYPE
def one_para():
con = CUBRIDdb.connect('CUBRID:localhost:33000:demodb:::', 'public')
c = con.cursor()
set_val=(('1','23','48'),)
etype = FIELD_TYPE.INT
c.execute("insert into set_tbl_int VALUES(?)", set_val,etype)
con.commit();
c.close()
con.close()
def two_para():
con = CUBRIDdb.connect('CUBRID:localhost:33000:demodb:::', 'public')
c = con.cursor()
set_val=(('abc','def'),('1','23','48'))
etype = (FIELD_TYPE.CHAR,FIELD_TYPE.INT)
c.execute('CREATE TABLE set_tbl_char_int ( col_1 set(CHAR(5)),col_2 set(int));')
c.execute('insert into set_tbl_int VALUES(?,?)', set_val,etype)
c.close()
con.close()
|