|
@@ -54,16 +54,30 @@ class SqlQueryBuilder():
|
54
|
54
|
"""
|
55
|
55
|
self.proxy = self.proxy.values(arg)
|
56
|
56
|
|
57
|
|
- def Execute(self):
|
|
57
|
+ def Execute(self, bindedparam):
|
58
|
58
|
"""
|
59
|
59
|
Execute the sql query constructed in the proxy and return the result.
|
60
|
60
|
If no query then return False.
|
61
|
61
|
@return: query result on success else False
|
62
|
62
|
"""
|
63
|
63
|
if(self.proxy.__str__().split() == 'SELECT'):
|
64
|
|
- return self.sqlwrapper.rconn.execute(self.proxy)
|
|
64
|
+ if('bindparam' in self.proxy.__str__()):
|
|
65
|
+ #on test separement la présence de la clause bindparam et le type de l'argument correspondant
|
|
66
|
+ #car si la clause est présente mais que l'argument est defectueux on doit renvoyer False et non pas executer la requete
|
|
67
|
+ if(type(bindedparam) is list and type(bindedparam[0]) is dict):
|
|
68
|
+ return self.sqlwrapper.rconn.execute(self.proxy, bindedparam)
|
|
69
|
+ else:
|
|
70
|
+ return False
|
|
71
|
+ else:
|
|
72
|
+ return self.sqlwrapper.rconn.execute(self.proxy)
|
65
|
73
|
elif(self.proxy is not None):
|
66
|
|
- return self.sqlwrapper.wconn.execute(self.proxy)
|
|
74
|
+ if('bindparam' in self.proxy.__str__()):
|
|
75
|
+ if(type(bindedparam) is list and type(bindedparam[0]) is dict):
|
|
76
|
+ return self.sqlwrapper.wconn.execute(self.proxy, bindedparam)
|
|
77
|
+ else:
|
|
78
|
+ return False
|
|
79
|
+ else:
|
|
80
|
+ return self.sqlwrapper.wconn.execute(self.proxy)
|
67
|
81
|
else:
|
68
|
82
|
return False
|
69
|
83
|
|