How to execute SQL code into Python Code?
SELECT RiskID.RiskID, RiskID.FuncID1, FUNCID.TCODE FROM RiskID INNER JOIN FUNCID ON RiskID.FuncID1 = FUNCID.FUNCID
How to execute SQL code into Python Code?
SELECT RiskID.RiskID, RiskID.FuncID1, FUNCID.TCODE FROM RiskID INNER JOIN FUNCID ON RiskID.FuncID1 = FUNCID.FUNCID
Hello,
You can try below code maybe it helps you
query = """(SELECT RiskID.RiskID, RiskID.FuncID1, FUNCID.TCODE FROM RiskID INNER JOIN FUNCID ON RiskID.FuncID1 = FUNCID.FUNCID)"""
cr = self._cr
cr.execute(query)
Thanks
Use below mentioned code: sql = """select count(name) from table_name where lower(field_name) = lower('%s') """ % self.field_name self.env.cr.execute(sql)
Hello
use self._cr.execute() to execute your sql query.
for eg. self._cr.execute("""SELECT RiskID.RiskID, RiskID.FuncID1, FUNCID.TCODE FROM RiskID INNER JOIN FUNCID ON RiskID.FuncID1 = FUNCID.FUNCID """)
then you can get your result using below code:
result = self._cr.dictfetchall() or result = self._cr.fetchall()
Create an account today to enjoy exclusive features and engage with our awesome community!
साइन अप करें
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.