Module _cubrid :: Class set
[hide private]
[frames] | no frames]

Class set

object --+
         |
        set

Set class. Process Set,MULTISET and LIST/SEQUENCE type The class is support by version 9.1.0.0003 and later

Instance Methods [hide private]
 
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
imports(data, type)
imports LIST/SET/MULTISET data.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

imports(data, type)

 
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()