How to Fetch data from Mysql and put into Postgressql using Server Action.
eg.select data from the mysql tables and copy into postgressql table.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How to Fetch data from Mysql and put into Postgressql using Server Action.
eg.select data from the mysql tables and copy into postgressql table.
hello..
first you have to install pymssql...(pip install pymssql)
Then create one server action by below python code:
conn = pymssql.connect(server=your_obj.url, port=your_obj.port_no, user=your_obj.user_name,password=your_obj.password, database=your_obj.database_name)
cur = conn.cursor()
cur.execute("SELECT col_name from your_table")
Thank You
Hey Vijay,
You need to import pymysql.
after this for connectivity.
def connection(self):
hostname = self.host_name
password = self.password
dbname = self.db_name
dbusername = self.db_user
try:
if self.connector == 'mysql':
db_connection = pymysql.connect(
hostname, dbusername, password, dbname)
cursor = db_connection.cursor()
#For Query
cursor.execute("show tables;")
datas = cursor.fetchall()
# If connection is not successful
except:
self.env.user.notify_warning(message='Connection Failed !')
return 0
self.env.user.notify_success(message='Connection Successful !')
I Hope it will Useful for you.
This code work for you ?
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
[Odoo V8] Server Actions
تم الحل
|
|
1
يوليو 15
|
4518 | |
|
0
مارس 25
|
1221 | ||
|
0
يناير 25
|
3279 | ||
|
2
أغسطس 24
|
1368 | ||
|
0
يناير 25
|
1208 |