当前位置:网站首页>How to associate the application on enterprise wechat with the Sybase database of the store
How to associate the application on enterprise wechat with the Sybase database of the store
2022-07-19 07:47:00 【CSDN Q & A】
Now all the sales data of the store , Are stored in the sybase Data in the database
And my application on enterprise wechat ( Deployed on alicloud servers ) To associate to this database , There are many data interactions
The method used now is , hold sybase The data on the database is synchronized to Alibaba cloud RDS Database , Then the program on Alibaba cloud's ECS reads RDS Data on the database
Aliyun server → Alibaba cloud RDS database → sybase database
Every time 2 Search once per second , If sales data is generated , Synchronize this change to Alibaba cloud mysql database
I'm using python Of pandas.read_sql Read sybase Data in the database , If there is new data , Send it to Alibaba cloud , do mysql The operation of adding, deleting, modifying and reducing
inv_table = pd.read_sql('SELECT * FROM p_inv', self.sybase_engine1, parse_dates='psl_date').apply(lambda x: x.astype(str).str.encode('cp850').str.decode('gbk')) inv_table = inv_table[inv_table['piv_date'] == self.today.strftime('%Y-%m-%d')] last_bill_num = inv_table['piv_bill_no'].values.tolist()[-1] print(last_bill_num, bill_num) if last_bill_num >= f'0{bill_num}': cols = ','.join(inv_table.columns.values) df = inv_table[inv_table['piv_bill_no'] == f'0{bill_num}'] print(df) if not df.empty: inv_sql = f"insert into p_inv({cols}) values(%s{
' ,%s' * (len(inv_table.columns) - 1)})" cursor.execute(inv_sql, df.values.tolist()[0]) self.ali_sales_conn.commit() self.update_p_sale_store(cursor, f'0{bill_num}') self.ali_sales_conn.commit()This is too complicated for me , Is there a simpler way , Just give me an idea
边栏推荐
- Spark3.x entry to proficiency - stage 6 (RDD advanced operator explanation & Illustration & shuffle tuning)
- Prevent blackmail attacks through data encryption schemes
- Flink entry to practice - phase I (cluster installation & use)
- This article introduces you to SOA interface testing
- FMC sub card: 4-channel 250msps sampling rate 16 bit AD acquisition sub card
- Servlet notes
- Flutter3.0(framework框架)——UI渲染
- Notepad++ underline and case letter replacement
- MySql02 函数substr mod 视图view
- Spark入门到精通-番外篇(Standaone集群的运维和简单操作)
猜你喜欢

卷积神经网络CNN

A2B音频总线在智能座舱中的应用

实时数据仓库-从0到1实时数据仓库设计&实现(SparkStreaming3.x)

Basic lighting knowledge of shader introduction

What if Jenkins forgets his password?

Flink entry to practice - phase I (cluster installation & use)

4-channel FMC interface baseband signal processing board (2 FMC interfaces, 2 fmc+ interfaces)

环境变量和文件夹放置位置

High concurrency day02 (concurrent package)

利用PCA来简化数据
随机推荐
Basic lighting knowledge of shader introduction
Flink入门到实战-阶段三(DataStreamAPI)
Gentoo installation tutorial (systemd+gnome)
Spark3.x-mysql method of actual combat to achieve Kafka precise one-time consumption
Flutter3.0 (framework) - UI rendering
如何选择合适的模型
Spark3.x entry to proficiency - stage 3 (in-depth analysis of the whole process of spark data processing)
pytorch随记(5)
RNN卷积神经网络
Spark introduction to proficient - external part (operation and maintenance and simple operation of standaone cluster)
Thales security solutions: key steps to improve national network security
Freebsd12 install gnome3 graphical interface
Slackware 14.2 installing KDE 5 plasma
SCI论文的Highlights怎么写(正经的教你怎么写)
理解LSTM和GRU
面部关键点检测-CNN
实操教程:CANoe在CAN总线测试中的应用
MongoDB的使用
SSM integration
4-channel FMC interface baseband signal processing board (2 FMC interfaces, 2 fmc+ interfaces)