import cx_Oracle
conn = cx_Oracle.connect('test/test@192.168.168.168/oracledb')
cur1 = conn.cursor()
cur2 = conn.cursor()
cur3 = conn.cursor() sql1 = "select t.* from authentication t"
cur1.execute(sql1)
# res = cur1.fetchmany(4) # 498409
res = cur1.fetchall()
# print(len(res))
s = 15800000000
for i in res:
temp = "'"+i[0]+"'"
print(temp)
s = s + 1
ss = "'"+str(s)+"'"
print(ss)
sql3 = "select t.* from userinfo t wehre t.auth_id = %s"%temp
cur3.execute(sql3)
res = cur3.fetchall()
if len(res)==1:
sql2 = "update userinfo t set t.user_account =%s where t.auth_id=%s"%(ss, temp)
cur2.execute(sql2)
conn.commit()
# conn.commit()
cur3.close()
cur2.close()
cur1.close()
conn.close()

  

python操作oracle实战的更多相关文章

  1. python操作oracle数据库-查询

    python操作oracle数据库-查询 参照文档 http://www.oracle.com/technetwork/cn/articles/dsl/mastering-oracle-python- ...

  2. Python操作Oracle数据库:cx_Oracle

    .caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px so ...

  3. python操作oracle小测试

    首先使用python操作数据库需要导入cx_Oracle包import cx_Oracle这个包需要单独下载,下载地址:https://pypi.python.org/pypi/cx_Oracle使用 ...

  4. python操作oracle数据库

    本文主要介绍python对oracle数据库的操作学习 包含:oracle数据库在Windows操作系统下的安装和配置.python需要安装的第三方拓展包以及基本操作的样例学习. 1          ...

  5. Python操作数据库实战

    pymysql # -*- coding: utf-8 -*- """ @Datetime: 2018/12/26 @Author: Zhang Yafei " ...

  6. python操作oracle完整教程

    1.    连接对象 操作数据库之前,首先要建立数据库连接.有下面几个方法进行连接. >>>import cx_Oracle>>>db = cx_Oracle.co ...

  7. Python操作Oracle

    [root@oracle02 pythonsoftware]# rpm -ivh oracle-instantclient-basic-11.1.0.1-1.x86_64.rpm Preparing. ...

  8. Python操作MySQL实战案例讲解

    使用Python的pymysql库连接MySQL数据库 #导入pymysql import pymysql #连接MySQL数据库 #输入数据库的IP地址,用户名,密码,端口 db=pymysql.c ...

  9. python接口自动化测试框架实现之操作oracle数据库

    python操作oracle数据库需要使用到cx-oracle库. 安装:pip install cx-oracle python连接oracle数据库分以下步骤: 1.与oracle建立连接: 2. ...

随机推荐

  1. ML.NET 示例:二元分类之垃圾短信检测

    写在前面 准备近期将微软的machinelearning-samples翻译成中文,水平有限,如有错漏,请大家多多指正. 如果有朋友对此感兴趣,可以加入我:https://github.com/fei ...

  2. 收藏pdf 链接

    python 入门: https://files.cnblogs.com/files/minsons/python%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E6%B7% ...

  3. RabbitMQ 优先级队列-为队列赋权

    RabbitMQ 消息收发是按顺序收发,一般情况下是先收到的消息先处理,即可以实现先进先出的消息处理.但如果消息者宕机或其他原因,导致消息接收以后,未确认,那么消息会重新Requeue到队列中,就打破 ...

  4. Jmeter(三十一)_数据驱动,业务关联

    这种数据驱动的本质是:将测试的case,参数,url,预期结果,存储于本地excel中.运行脚本时,从文件中获取预期结果,将实际结果与预期结果比较,将实际结果,比较结果,响应状态码回写excel. 一 ...

  5. open-falcon ---客户机agent操作

    open-falcon的agent用于采集机器负载监控指标,比如cpu.idle.load.1min.disk.io.util等等,每隔60秒push给Transfer.agent与Transfer建 ...

  6. 'config.h' file not found 解决过程

    最近将ReactNative业务集成进现有APP项目中,出现了几个具有代表性的问题,下面记录一下 问题1. [!] CocoaPods could not find compatible versio ...

  7. php ajax登录注册

    用户登录与退出功能应用在很多地方,而在有些项目中,我们需要使用Ajax方式进行登录,登录成功后只刷新页面局部,从而提升了用户体验度.本文将使用PHP和jQuery来实现登录和退出功能. 准备数据库 本 ...

  8. 2017-2018-2 1723《程序设计与数据结构》第九周作业 & 第二周结对编程 总结

    作业地址 第九次作业:https://edu.cnblogs.com/campus/besti/CS-IMIS-1723/homework/1878 (作业界面已评分,可随时查看,如果对自己的评分有意 ...

  9. Magazine Ad CodeForces - 803D (二分+贪心)

    The main city magazine offers its readers an opportunity to publish their ads. The format of the ad ...

  10. format()函数用法

    基本语法是通过 {} 和 : 来代替以前的 % . format 函数可以接受不限个参数,位置可以不按顺序. 直接打印输出参数: 通过字典设置参数: 通过列表索引设置参数: