[Zope-Checkins] CVS: Products/DCOracle2/test - test15.py:1.2 common.py:1.5 procdef.sql:1.12 test11.py:1.2 test9.py:1.10

Matthew T. Kromer matt@zope.com
Mon, 25 Feb 2002 11:21:07 -0500


Update of /cvs-repository/Products/DCOracle2/test
In directory cvs.zope.org:/tmp/cvs-serv2436/test

Modified Files:
	common.py procdef.sql test11.py test9.py 
Added Files:
	test15.py 
Log Message:
merges from object test branch


=== Products/DCOracle2/test/test15.py 1.1 => 1.2 ===
+# This assumes that the procdef.sql script has been run
+#
+# test input manual bindings for TABLE OF VARCHAR2
+#
+
+
+import DCOracle2
+import common
+import sys
+
+#r = sys.stdin.read()
+
+db = DCOracle2.connect(common.getConnectionString())
+c = db.cursor()
+#bao = db.BindingArray(10, 64, 'SQLT_STR')
+
+#print len(bao)
+
+#c.execute("begin :1 := emp_actions.find(7902); end;", bao)
+
+#print len(bao)
+#print bao[0]
+
+bao = db.BindingArray(10,20,'SQLT_STR')
+bao[0] = 'Mary'
+bao[1] = 'Had'
+bao[2] = 'A'
+bao[3] = 'Little'
+bao[4] = 'Lamb'
+
+print c.execute("begin emp_actions.taketab(:1); end;", bao)
+
+print c.procedures.emp_actions.taketab(bao)
+
+
+print c.procedures.emp_actions.taketab(['Mary','had','a','little','lamb'])
+
+print c.procedures.emp_actions.returntab()


=== Products/DCOracle2/test/common.py 1.4 => 1.5 ===
     "fizzle.mi.org":  "scott/tiger@bane",
     "sidhe.mi.org":     "scott/tiger@sidhe",
-    "djinn.digicool.com":  "scott/tiger"
+    "djinn.digicool.com":  "scott/tiger",
+    "djinn.zope.com":  "scott/tiger"
 }
 
 


=== Products/DCOracle2/test/procdef.sql 1.11 => 1.12 ===
 create or replace package EMP_ACTIONS as
 	type ref_cursor is ref cursor;
-	type string_tab is varray(20) of varchar2;
+	type string_tab is table of varchar2(20) index by binary_integer;
 
 	function FIND (
 		EMPID integer
@@ -65,6 +65,10 @@
 		IDS in string_tab
 	);
 
+	procedure RETURNTAB (
+		POEM out string_tab
+	);
+
 	procedure NUM(
 		VALUE in out number
 	);
@@ -166,6 +170,19 @@
 		end LOOP;
 
 	end TAKETAB;
+
+	procedure RETURNTAB (
+		POEM out string_tab
+	) is
+
+	begin
+		POEM(1) := 'Mary';
+		POEM(2) := 'had';
+		POEM(3) := 'a';
+		POEM(4) := 'little';
+		POEM(5) := 'lamb';
+	end RETURNTAB;
+
 
 end EMP_ACTIONS;
 /


=== Products/DCOracle2/test/test11.py 1.1 => 1.2 ===
 import common
 
+
+DCOracle2.registerDateConversion(lambda x: ".date(%s)." % x)
+
 db = DCOracle2.connect(common.getConnectionString())
 
 #r = sys.stdin.read()
@@ -29,3 +32,4 @@
 saved = r[1]
 
 print "Well: %s vs %s" % (now, saved)
+


=== Products/DCOracle2/test/test9.py 1.9 => 1.10 ===
 d = db.describe('emp_actions')
 
+print db.decodedesc(d); sys.exit(0)
+
+
 #pprint(db.collapsedesc(d))
 
 e = db.describe('emp')