Explorar el Código

Informix-ODBC Test

gc-server3 hace 7 meses
padre
commit
0eca723049
Se han modificado 1 ficheros con 22 adiciones y 0 borrados
  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)