Home | History | Annotate | Download | only in test

Lines Matching refs:cur

36         self.cur = self.con.cursor()
37 self.cur.execute("create table test(i integer, s varchar, f number, b blob)")
40 self.cur.close()
44 self.cur.execute("insert into test(s) values (?)", ("?sterreich",))
45 self.cur.execute("select s from test")
46 row = self.cur.fetchone()
50 self.cur.execute("insert into test(i) values (?)", (42,))
51 self.cur.execute("select i from test")
52 row = self.cur.fetchone()
57 self.cur.execute("insert into test(i) values (?)", (num,))
58 self.cur.execute("select i from test")
59 row = self.cur.fetchone()
64 self.cur.execute("insert into test(f) values (?)", (val,))
65 self.cur.execute("select f from test")
66 row = self.cur.fetchone()
72 self.cur.execute("insert into test(b) values (?)", (val,))
73 self.cur.execute("select b from test")
74 row = self.cur.fetchone()
78 self.cur.execute("select '?sterreich'")
79 row = self.cur.fetchone()
107 self.cur = self.con.cursor()
108 self.cur.execute("create table test(i int, s str, f float, b bool, u unicode, foo foo, bin blob, n1 number, n2 number(5))")
124 self.cur.close()
129 self.cur.execute("insert into test(s) values (?)", ("foo",))
130 self.cur.execute('select s as "s [WRONG]" from test')
131 row = self.cur.fetchone()
136 self.cur.execute("insert into test(i) values (?)", (42,))
137 self.cur.execute("select i from test")
138 row = self.cur.fetchone()
144 self.cur.execute("insert into test(i) values (?)", (num,))
145 self.cur.execute("select i from test")
146 row = self.cur.fetchone()
152 self.cur.execute("insert into test(f) values (?)", (val,))
153 self.cur.execute("select f from test")
154 row = self.cur.fetchone()
159 self.cur.execute("insert into test(b) values (?)", (False,))
160 self.cur.execute("select b from test")
161 row = self.cur.fetchone()
164 self.cur.execute("delete from test")
165 self.cur.execute("insert into test(b) values (?)", (True,))
166 self.cur.execute("select b from test")
167 row = self.cur.fetchone()
173 self.cur.execute("insert into test(u) values (?)", (val,))
174 self.cur.execute("select u from test")
175 row = self.cur.fetchone()
180 self.cur.execute("insert into test(foo) values (?)", (val,))
181 self.cur.execute("select foo from test")
182 row = self.cur.fetchone()
189 self.cur.execute("insert into test(f) values (?)", (val,))
195 self.cur.execute("insert into test(f) values (:val)", {"val": val})
201 self.cur.execute("insert into test(bin) values (?)", (val,))
202 self.cur.execute("select bin from test")
203 row = self.cur.fetchone()
207 self.cur.execute("insert into test(n1) values (5)")
208 value = self.cur.execute("select n1 from test").fetchone()[0]
214 self.cur.execute("insert into test(n2) values (5)")
215 value = self.cur.execute("select n2 from test").fetchone()[0]
222 self.cur = self.con.cursor()
223 self.cur.execute("create table test(x foo)")
235 self.cur.close()
243 self.cur.execute("insert into test(x) values (?)", ("xxx",))
244 self.cur.execute("select x from test")
245 val = self.cur.fetchone()[0]
249 self.cur.execute("insert into test(x) values (?)", (None,))
250 self.cur.execute("select x from test")
251 val = self.cur.fetchone()[0]
255 self.cur.execute("insert into test(x) values (?)", ("xxx",))
256 self.cur.execute('select x as "x [bar]" from test')
257 val = self.cur.fetchone()[0]
262 self.assertEqual(self.cur.description[0][0], "x")
265 self.cur.execute("select 'other' as \"x [b1b1]\"")
266 val = self.cur.fetchone()[0]
274 self.cur.execute("select * from test where 0 = 1")
275 self.assertEqual(self.cur.description[0][0], "x")
278 self.cur.execute("insert into test values (1)")
279 self.assertIsNone(self.cur.description)
287 self.cur = self.con.cursor()
288 self.cur.execute("create table test(x foo)")
291 self.cur.close()
295 self.cur.execute("with one as (select 1) select * from one")
296 self.assertIsNotNone(self.cur.description)
297 self.assertEqual(self.cur.description[0][0], "1")
300 self.cur.execute("insert into test values(1)")
301 self.cur.execute("insert into test values(2)")
302 self.cur.execute("with testCTE as (select * from test) select * from testCTE")
303 self.assertIsNotNone(self.cur.description)
304 self.assertEqual(self.cur.description[0][0], "x")
307 self.cur.execute("insert into test values (1)")
308 self.cur.execute("with bar as (select * from test) select * from test where x = 1")
309 self.assertIsNotNone(self.cur.description)
310 self.assertEqual(self.cur.description[0][0], "x")
311 self.cur.execute("with bar as (select * from test) select * from test where x = 2")
312 self.assertIsNotNone(self.cur.description)
313 self.assertEqual(self.cur.description[0][0], "x")
328 self.cur = self.con.cursor()
332 self.cur.close()
336 self.cur.execute("select ?", (4,))
337 val = self.cur.fetchone()[0]
361 self.cur = self.con.cursor()
362 self.cur.execute("create table test(d date, ts timestamp)")
365 self.cur.close()
370 self.cur.execute("insert into test(d) values (?)", (d,))
371 self.cur.execute("select d from test")
372 d2 = self.cur.fetchone()[0]
377 self.cur.execute("insert into test(ts) values (?)", (ts,))
378 self.cur.execute("select ts from test")
379 ts2 = self.cur.fetchone()[0]
386 self.cur.execute("insert into test(ts) values (current_timestamp)")
387 self.cur.execute("select ts from test")
388 ts = self.cur.fetchone()[0]
394 self.cur.execute("insert into test(ts) values (?)", (ts,))
395 self.cur.execute("select ts from test")
396 ts2 = self.cur.fetchone()[0]
401 self.cur.execute("insert into test(ts) values (?)", (ts,))
402 self.cur.execute("select ts from test")
403 ts2 = self.cur.fetchone()[0]