def oracle_connect(self, mobile):
# ??????
t = time.strftime('%Y%m%d', time.localtime(time.time()))
# ??oracle????????
conn = cx_Oracle.connect('???/??')
cursor = conn.cursor()
# ?????SQL???????
sql = r"select * from (select sms_inf from gwadm.SMSTSMmO where mbl_no = " + "'" + mobile + "'" + " and tx_dt = " + t + " order by OPR_TM desc)where rownum <= 1"
cursor.execute(sql)
row = cursor.fetchone()
cursor.close()
conn.close()
code = []
# ??????????
for i in row[0]:
if i.isdigit():
code.append(i)
return ''.join(code)
评论列表
文章目录