Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added SQL Server test func_param for issue 106.

  • Loading branch information...
commit 0aa12e08e981d6688cced5f8cbfddcedcef7fecf 1 parent 2949f23
@mkleehammer authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 tests/sqlservertests.py
View
21 tests/sqlservertests.py
@@ -90,6 +90,12 @@ def setUp(self):
except:
pass
+ try:
+ self.cursor.execute('drop function func1')
+ self.cnxn.commit()
+ except:
+ pass
+
self.cnxn.rollback()
def tearDown(self):
@@ -1201,6 +1207,21 @@ def test_large_update_nodata(self):
hundredkb = buffer('x'*100*1024)
self.cursor.execute('update t1 set a=? where 1=0', (hundredkb,))
+ def test_func_param(self):
+ self.cursor.execute('''
+ create function func1 (@testparam varchar(4))
+ returns @rettest table (param varchar(4))
+ as
+ begin
+ insert @rettest
+ select @testparam
+ return
+ end
+ ''')
+ self.cnxn.commit()
+ value = self.cursor.execute("select * from func1(?)", 'test').fetchone()[0]
+ self.assertEquals(value, 'test')
+
def main():
from optparse import OptionParser
Please sign in to comment.
Something went wrong with that request. Please try again.