| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- # coding=utf-8
- '''
- Created on Apr 21, 2016
- @author: root
- '''
- import os
- os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8'
- import cx_Oracle
- import time
- class Test(object):
-
- def __init__(self):
- pass
-
-
- if __name__ == '__main__':
- timeStart = time.time()
-
- conn = cx_Oracle.connect('uuplatformdemo/selectuuplatform@192.168.253.6/orcl')
- cursor = conn.cursor()
- # cursor.execute("select table_name, tablespace_name from user_tables")
- # cursor.execute("select * from product$brand_temp")
- # row = cursor.fetchone()
- # cursor.execute("select * from product$brand_temp")
-
- # cursor.execute ("INSERT INTO product$component_temp (ID, COL1, COL2, COL3)VALUES(1, 'a', 'b', 'c')")
-
- # cursor.execute ("INSERT INTO product$component_temp ( cmp_id, cmp_code, cmp_img, cmp_uuid, cmp_description, cmp_brid, cmp_kiid, cmp_company )VALUES(2, 'a', 'c', 'sdfs', 'c', 1, 1, 'c')")
- # cursor.execute ("INSERT INTO product$propertyvalue_temp (pv_id, pv_componentid, pv_detno, pv_propertyid, pv_value )VALUES(1, 1, 3, 1, '后壳')")
-
- list_test = list((i, 1, 1, 1, "wocalei") for i in range(1, 100000))
- cursor.prepare('insert into product$propertyvalue_temp (pv_id, pv_componentid, pv_detno, pv_propertyid, pv_value ) values(:1, :2, :3, :4, :5)') #
- cursor.executemany(None, list_test)
-
- # cursor.execute (sql_str)
-
- conn.commit()
- conn.commit()
- conn.commit()
-
-
- cursor.close ()
- conn.close ()
-
- timeEnd = time.time()
- timeCount = timeEnd - timeStart
- print (timeCount, "s")
- print (timeCount/60, "min")
- print (timeCount/3600, "h")
-
|