ソースを参照

Informix-ODBC Test

gc-server3 7 ヶ月 前
コミット
0eca723049
1 ファイル変更22 行追加0 行削除
  1. 22 0
      sandbox/informix.py

+ 22 - 0
sandbox/informix.py

@@ -0,0 +1,22 @@
+import IfxPy
+
+ConStr = "SERVER=gc-server6;DATABASE=csdb;HOST=192.168.2.46;SERVICE=9088;UID=informix;PWD=Gcbs12ma;"
+
+conn = IfxPy.connect(ConStr, "", "")
+
+sql = "SELECT cmid, objid FROM cmobjprops1 WHERE objid IN ('::Everyone', '::System Administrators') OR objid LIKE 'CognosEx:%'"
+stmt = IfxPy.exec_immediate(conn, sql)
+dictionary = IfxPy.fetch_both(stmt)
+
+rc = 0
+while dictionary != False:
+    rc += 1
+    print("--  Record {0} --".format(rc))
+    print("c1 is : ", dictionary[0])
+    print("c2 is : ", dictionary[1])
+    print("c3 is : ", dictionary["c3"])
+    print("c4 is : ", dictionary[3])
+    print(" ")
+    dictionary = IfxPy.fetch_both(stmt)
+
+IfxPy.close(conn)