| Trees | Indices | Help |
|---|
|
|
object --+
|
lob
Lob class. Process BLOB/CLOB type
|
|||
|
|||
| a new object with type S, a subtype of T |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
x.__init__(...) initializes x; see help(type(x)) for signature
|
|
export BLOB/CLOB data to the specified file. To use this function, you must use fetch_lob() in cursor class first to get BLOB/CLOB info from CUBRID. file: string, support filepath/file Example:
import _cubrid
con = _cubrid.connect('CUBRID:localhost:33000:demodb:::', 'public')
cur = con.cursor()
cur.prepare('select * from test_lob')
cur.execute()
lob = con.lob()
cur.fetch_lob(1, lob)
lob.export('out')
lob.close()
cur.close()
con.close()
|
imports file in CUBRID server. If not give the type, it will be processed as BLOB. |
read a chunk of data from the current file position. If not given the length, it will read all the remaining data. Return a string that contains the data read. Example 1:
import _cubrid
con = _cubrid.connect('CUBRID:localhost:33000:demodb:::', 'public')
lob = con.lob()
lob.imports('README', 'C')
str = lob.read(32)
print str
lob.close()
con.clsoe()
Example 2:
import _cubrid
con = _cubrid.connect('CUBRID:localhost:33000:demodb:::', 'public')
cur = con.cursor()
cur.prepare('select * from test_lob')
cur.execute()
lob = con.lob()
cur.fetch_lob(1, lob)
print lob.read(32)
lob.close()
cur.close()
con.close()
|
move the LOB object current position to the direction LOB object according to the mode whence giving. The argument whence can be the following values:
Return the current position of the cursor. |
writes a string to the large object.If LOB object does not exist. It will be create a BLOB object as default. Example 1:
import _cubrid
con = _cubrid.connect('CUBRID:localhost:33000:demodb:::', 'public')
cur = con.cursor()
cur.prepare('insert into test_clob(content) values (?)')
lob = con.lob()
content = 'CUBRID is a very powerful RDBMS'
lob.write(content, 'C')
cur.bind_lob(1, lob)
cur.execute()
lob.close()
cur.close()
con.close()
Example 2:
import _cubrid
con = _cubrid.connect('CUBRID:localhost:33000:demodb:::', 'public')
cur = con.cursor()
cur.prepare('select * from test_blob')
cur.execute()
lob = con.lob()
cur.fetch_lob(1, lob)
lob.seek(50, SEEK_CUR)
lob.write('CUBRID a powerfer database')
lob.close()
cur.close()
con.close()
|
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Fri Mar 28 11:44:57 2014 | http://epydoc.sourceforge.net |