File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1- 0.9.0
1+ 0.9.1
Original file line number Diff line number Diff line change @@ -269,6 +269,26 @@ def execute_sql_string(self, sqlString):
269269 if cur :
270270 self ._dbconnection .rollback ()
271271
272+ def execute_sql_string_sanstran (self , sqlString ):
273+ """
274+ Executes the sqlString as SQL commands.
275+ Useful to pass arguments to your sql.
276+ Does not wrap execution in transaction!
277+
278+ SQL commands are expected to be delimited by a semi-colon (';').
279+
280+ For example:
281+ | Check If Exists In Database SELECT * FROM dbo.ExampleTable WHERE Id = 1 AND ExampleFlag = 0
282+ | Execute Sql String Sanstran BEGIN TRAN
283+ | Execute Sql String Sanstran UPDATE dbo.ExampleTable SET ExampleFlag = 1 WHERE Id = 1 AND ExampleFlag = 0
284+ | Check If Exists In Database SELECT * FROM dbo.ExampleTable WHERE Id = 1 AND ExampleFlag = 1
285+ | Execute Sql String Sanstran ROLLBACK TRAN
286+ | Check If Exists In Database SELECT * FROM dbo.ExampleTable WHERE Id = 1 AND ExampleFlag = 0
287+ """
288+ cur = self ._dbconnection .cursor ()
289+ logger .info ('Executing : Execute SQL String Sanstran | %s ' % (sqlString ))
290+ self .__execute_sql (cur , sqlString )
291+
272292 def call_stored_procedure (self , spName , spParams = None ):
273293 """
274294 Uses the inputs of spName and spParams to call a stored procedure
You can’t perform that action at this time.
0 commit comments