-
Notifications
You must be signed in to change notification settings - Fork 191
/
test_140_BindParamSelectStmt.py
59 lines (51 loc) · 1.21 KB
/
test_140_BindParamSelectStmt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# Licensed Materials - Property of IBM
#
# (c) Copyright IBM Corp. 2007-2008
#
from __future__ import print_function
import sys
import unittest
import ibm_db
import config
from testfunctions import IbmDbTestFunctions
class IbmDbTestCase(unittest.TestCase):
def test_140_BindParamSelectStmt(self):
obj = IbmDbTestFunctions()
obj.assert_expect(self.run_test_140)
def run_test_140(self):
conn = ibm_db.connect(config.database, config.user, config.password)
if conn:
stmt = ibm_db.prepare(conn, "SELECT id, breed, name, weight FROM animals WHERE id = ?")
animal = 0
ibm_db.bind_param(stmt, 1, animal)
if ibm_db.execute(stmt):
row = ibm_db.fetch_tuple(stmt)
while ( row ):
#roiw.each { |child| puts child }
for i in row:
print(i)
row = ibm_db.fetch_tuple(stmt)
else:
print("Connection failed.")
#__END__
#__LUW_EXPECTED__
#0
#cat
#Pook
#3.20
#__ZOS_EXPECTED__
#0
#cat
#Pook
#3.20
#__SYSTEMI_EXPECTED__
#0
#cat
#Pook
#3.20
#__IDS_EXPECTED__
#0
#cat
#Pook
#3.20