diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index 28f02fe..53a50c3 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -75,7 +75,7 @@ $(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
 endif
 
 # Common options for tests. Also pick up anything passed in EXTRA_REGRESS_OPTS
-REGRESS_OPTS = --dbname=ecpg1_regression,ecpg2_regression --create-role=regress_ecpg_user1,regress_ecpg_user2 $(EXTRA_REGRESS_OPTS)
+REGRESS_OPTS = --dbname=ecpg1_regression,ecpg2_regression,ecpg3_regression --create-role=regress_ecpg_user1,regress_ecpg_user2 $(EXTRA_REGRESS_OPTS)
 
 check: all
 	$(with_temp_install) ./pg_regress $(REGRESS_OPTS) --temp-instance=./tmp_check $(TEMP_CONF) --bindir= $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule
diff --git a/src/interfaces/ecpg/test/ecpg_schedule b/src/interfaces/ecpg/test/ecpg_schedule
index c3ec125..5f7fe5b 100644
--- a/src/interfaces/ecpg/test/ecpg_schedule
+++ b/src/interfaces/ecpg/test/ecpg_schedule
@@ -48,6 +48,7 @@ test: sql/quote
 test: sql/show
 test: sql/insupd
 test: sql/parser
+test: sql/declare
 test: thread/thread
 test: thread/thread_implicit
 test: thread/prep
diff --git a/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c b/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
index 1f316fb..b4a7c44 100644
--- a/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
+++ b/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
@@ -241,7 +241,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "open");
-	{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1", 
+	{ ECPGopen("mycur1", "st_id1", __LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 101 "sqlda.pgc"
@@ -258,7 +258,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	while (1)
 	{
 		strcpy(msg, "fetch");
-		{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT, 
+		{ ECPGfetch("mycur1", __LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT, 
 	ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
 #line 109 "sqlda.pgc"
@@ -279,7 +279,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "close");
-	{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("mycur1", __LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT);
 #line 118 "sqlda.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
@@ -316,7 +316,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "open");
-	{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1", 
+	{ ECPGopen("mycur2", "st_id2", __LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 138 "sqlda.pgc"
@@ -333,7 +333,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	while (1)
 	{
 		strcpy(msg, "fetch");
-		{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch from mycur2", ECPGt_EOIT, 
+		{ ECPGfetch("mycur2", __LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch from mycur2", ECPGt_EOIT, 
 	ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
 #line 146 "sqlda.pgc"
@@ -354,7 +354,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "close");
-	{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("mycur2", __LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT);
 #line 155 "sqlda.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
diff --git a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c
index 9934947..48b9197 100644
--- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c
+++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c
@@ -158,7 +158,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
 
 	while (1)
 	{
-		{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch forward c", ECPGt_EOIT, 
+		{ ECPGfetch("c", __LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch forward c", ECPGt_EOIT, 
 	ECPGt_int,&(i),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_decimal,&(j),(long)1,(long)1,sizeof(decimal), 
@@ -244,7 +244,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
 
 static void openit(void)
 {
-	{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare c cursor for select * from test where i <= $1 ", 
+	{ ECPGopen("c", NULL, __LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare c cursor for select * from test where i <= $1 ", 
 	ECPGt_int,&(*( int  *)(ECPGget_var( 0))),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 95 "test_informix.pgc"
diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c b/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
index a56513a..ffa5687 100644
--- a/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
+++ b/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
@@ -82,7 +82,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 	/* declare cur cursor for select id , d , d from nantest1 */
 #line 33 "nan_test.pgc"
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen("cur", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
 #line 34 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
@@ -90,7 +90,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 
 	while (1)
 	{
-		{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur", ECPGt_EOIT, 
+		{ ECPGfetch("cur", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur", ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_double,&(d),(long)1,(long)1,sizeof(double), 
@@ -130,14 +130,14 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 #line 46 "nan_test.pgc"
 
 	}
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("cur", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
 #line 48 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
 #line 48 "nan_test.pgc"
 
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen("cur", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
 #line 50 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
@@ -145,7 +145,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 
 	while (1)
 	{
-		{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur", ECPGt_EOIT, 
+		{ ECPGfetch("cur", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur", ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_double,&(d),(long)1,(long)1,sizeof(double), 
@@ -164,7 +164,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 		if (isnan(d))
 			printf("%d  NaN '%s'\n", id, val);
 	}
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("cur", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
 #line 61 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
@@ -221,7 +221,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 	/* declare cur1 cursor for select id , d , d from nantest2 */
 #line 75 "nan_test.pgc"
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur1 cursor for select id , d , d from nantest2", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen("cur1", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur1 cursor for select id , d , d from nantest2", ECPGt_EOIT, ECPGt_EORT);
 #line 76 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
@@ -229,7 +229,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 
 	while (1)
 	{
-		{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur1", ECPGt_EOIT, 
+		{ ECPGfetch("cur1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur1", ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric), 
@@ -245,7 +245,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 			break;
 		printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
 	}
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur1", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("cur1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur1", ECPGt_EOIT, ECPGt_EORT);
 #line 84 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
diff --git a/src/interfaces/ecpg/test/expected/preproc-autoprep.c b/src/interfaces/ecpg/test/expected/preproc-autoprep.c
index 10ede3e..e3abb29 100644
--- a/src/interfaces/ecpg/test/expected/preproc-autoprep.c
+++ b/src/interfaces/ecpg/test/expected/preproc-autoprep.c
@@ -133,7 +133,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 35 "autoprep.pgc"
 
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select Item1 from T", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGopen("C", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select Item1 from T", ECPGt_EOIT, ECPGt_EORT);
 #line 37 "autoprep.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
@@ -143,7 +143,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 37 "autoprep.pgc"
 
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in C", ECPGt_EOIT, 
+  { ECPGfetch("C", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in C", ECPGt_EOIT, 
 	ECPGt_int,&(i),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
 #line 39 "autoprep.pgc"
@@ -156,7 +156,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
   printf("i = %d\n", i);
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close C", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGclose("C", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close C", ECPGt_EOIT, ECPGt_EORT);
 #line 42 "autoprep.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
@@ -180,7 +180,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 46 "autoprep.pgc"
 
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur1 cursor for $1", 
+  { ECPGopen("cur1", "stmt1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur1 cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "stmt1", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 48 "autoprep.pgc"
@@ -199,7 +199,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
   i = 0;
   while (1)
   {
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur1", ECPGt_EOIT, 
+	{ ECPGfetch("cur1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur1", ECPGt_EOIT, 
 	ECPGt_int,&(item1),(long)1,(long)1,sizeof(int), 
 	ECPGt_int,&(ind1),(long)1,(long)1,sizeof(int), ECPGt_EORT);
 #line 55 "autoprep.pgc"
@@ -217,7 +217,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 	i++;
   }
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur1", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGclose("cur1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur1", ECPGt_EOIT, ECPGt_EORT);
 #line 60 "autoprep.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
diff --git a/src/interfaces/ecpg/test/expected/preproc-cursor.c b/src/interfaces/ecpg/test/expected/preproc-cursor.c
index f7da753..ad86a56 100644
--- a/src/interfaces/ecpg/test/expected/preproc-cursor.c
+++ b/src/interfaces/ecpg/test/expected/preproc-cursor.c
@@ -187,7 +187,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "open");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "declare $0 cursor for select id , t from t1", 
+	{ ECPGopen(":curname1", NULL, __LINE__, 0, 1, "test1", 0, ECPGst_normal, "declare $0 cursor for select id , t from t1", 
 	ECPGt_char,&(curname1),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 67 "cursor.pgc"
@@ -197,7 +197,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "fetch from");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch forward from $0", 
+	{ ECPGfetch(":curname1", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch forward from $0", 
 	ECPGt_char,&(curname1),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -212,7 +212,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "fetch");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch forward $0", 
+	{ ECPGfetch(":curname1", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch forward $0", 
 	ECPGt_char,&(curname1),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -227,7 +227,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "fetch 1 from");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 from $0", 
+	{ ECPGfetch(":curname1", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 from $0", 
 	ECPGt_char,&(curname1),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -243,7 +243,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	strcpy(msg, "fetch :count from");
 	count = 1;
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 from $0", 
+	{ ECPGfetch(":curname1", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 from $0", 
 	ECPGt_int,&(count),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,&(curname1),(long)0,(long)1,(1)*sizeof(char), 
@@ -260,7 +260,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "move in");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "move absolute 0 in $0", 
+	{ ECPGfetch(":curname1", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "move absolute 0 in $0", 
 	ECPGt_char,&(curname1),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 87 "cursor.pgc"
@@ -270,7 +270,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "fetch 1");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 $0", 
+	{ ECPGfetch(":curname1", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 $0", 
 	ECPGt_char,&(curname1),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -286,7 +286,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	strcpy(msg, "fetch :count");
 	count = 1;
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 $0", 
+	{ ECPGfetch(":curname1", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 $0", 
 	ECPGt_int,&(count),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,&(curname1),(long)0,(long)1,(1)*sizeof(char), 
@@ -303,7 +303,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "close");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "close $0", 
+	{ ECPGclose(":curname1", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "close $0", 
 	ECPGt_char,&(curname1),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 99 "cursor.pgc"
@@ -323,7 +323,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "open");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "declare $0 cursor for select id , t from t1", 
+	{ ECPGopen(":curname2", NULL, __LINE__, 0, 1, "test1", 0, ECPGst_normal, "declare $0 cursor for select id , t from t1", 
 	ECPGt_char,&(curname2),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -337,7 +337,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "fetch from");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch from $0", 
+	{ ECPGfetch(":curname2", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch from $0", 
 	ECPGt_char,&(curname2),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -352,7 +352,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "fetch");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0", 
+	{ ECPGfetch(":curname2", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0", 
 	ECPGt_char,&(curname2),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -367,7 +367,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "fetch 1 from");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 from $0", 
+	{ ECPGfetch(":curname2", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 from $0", 
 	ECPGt_char,&(curname2),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -383,7 +383,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	strcpy(msg, "fetch :count from");
 	count = 1;
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 from $0", 
+	{ ECPGfetch(":curname2", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 from $0", 
 	ECPGt_int,&(count),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,&(curname2),(long)0,(long)1,(1)*sizeof(char), 
@@ -400,7 +400,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "move");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "move absolute 0 $0", 
+	{ ECPGfetch(":curname2", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "move absolute 0 $0", 
 	ECPGt_char,&(curname2),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -414,7 +414,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "fetch 1");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 $0", 
+	{ ECPGfetch(":curname2", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 $0", 
 	ECPGt_char,&(curname2),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -430,7 +430,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	strcpy(msg, "fetch :count");
 	count = 1;
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 $0", 
+	{ ECPGfetch(":curname2", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 $0", 
 	ECPGt_int,&(count),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,&(curname2),(long)0,(long)1,(1)*sizeof(char), 
@@ -447,7 +447,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "close");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "close $0", 
+	{ ECPGclose(":curname2", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "close $0", 
 	ECPGt_char,&(curname2),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 140 "cursor.pgc"
@@ -483,7 +483,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "open");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "declare $0 cursor for $1", 
+	{ ECPGopen(":curname3", "st_id1", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "declare $0 cursor for $1", 
 	ECPGt_char,&(curname3),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char_variable,(ECPGprepared_statement("test1", "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
@@ -493,7 +493,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 if (sqlca.sqlcode < 0) exit (1);}
 #line 153 "cursor.pgc"
 
-	{ ECPGdo(__LINE__, 0, 1, "test2", 0, ECPGst_normal, "declare $0 cursor for $1", 
+	{ ECPGopen(":curname5", "st_id1", __LINE__, 0, 1, "test2", 0, ECPGst_normal, "declare $0 cursor for $1", 
 	ECPGt_char,&(curname5),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char_variable,(ECPGprepared_statement("test2", "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
@@ -505,7 +505,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "fetch");
-	{ ECPGdo(__LINE__, 0, 1, "test2", 0, ECPGst_normal, "fetch $0", 
+	{ ECPGfetch(":curname5", __LINE__, 0, 1, "test2", 0, ECPGst_normal, "fetch $0", 
 	ECPGt_char,&(curname5),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -520,7 +520,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "fetch from");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch from $0", 
+	{ ECPGfetch(":curname3", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch from $0", 
 	ECPGt_char,&(curname3),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -535,7 +535,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "fetch 1 from");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 from $0", 
+	{ ECPGfetch(":curname3", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 from $0", 
 	ECPGt_char,&(curname3),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -551,7 +551,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	strcpy(msg, "fetch :count from");
 	count = 1;
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 from $0", 
+	{ ECPGfetch(":curname3", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 from $0", 
 	ECPGt_int,&(count),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,&(curname3),(long)0,(long)1,(1)*sizeof(char), 
@@ -568,7 +568,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "move");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "move absolute 0 $0", 
+	{ ECPGfetch(":curname3", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "move absolute 0 $0", 
 	ECPGt_char,&(curname3),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 174 "cursor.pgc"
@@ -578,7 +578,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "fetch 1");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 $0", 
+	{ ECPGfetch(":curname3", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 $0", 
 	ECPGt_char,&(curname3),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -594,7 +594,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	strcpy(msg, "fetch :count");
 	count = 1;
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 $0", 
+	{ ECPGfetch(":curname3", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 $0", 
 	ECPGt_int,&(count),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,&(curname3),(long)0,(long)1,(1)*sizeof(char), 
@@ -611,7 +611,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "close");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "close $0", 
+	{ ECPGclose(":curname3", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "close $0", 
 	ECPGt_char,&(curname3),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 186 "cursor.pgc"
@@ -619,7 +619,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 if (sqlca.sqlcode < 0) exit (1);}
 #line 186 "cursor.pgc"
 
-	{ ECPGdo(__LINE__, 0, 1, "test2", 0, ECPGst_normal, "close $0", 
+	{ ECPGclose(":curname5", __LINE__, 0, 1, "test2", 0, ECPGst_normal, "close $0", 
 	ECPGt_char,&(curname5),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 187 "cursor.pgc"
@@ -663,7 +663,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "open");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "declare $0 cursor for $1", 
+	{ ECPGopen(":curname4", "st_id2", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "declare $0 cursor for $1", 
 	ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char_variable,(ECPGprepared_statement("test1", "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
@@ -675,7 +675,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "fetch from");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch from $0", 
+	{ ECPGfetch(":curname4", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch from $0", 
 	ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -690,7 +690,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "fetch");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0", 
+	{ ECPGfetch(":curname4", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0", 
 	ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -705,7 +705,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "fetch 1 from");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 from $0", 
+	{ ECPGfetch(":curname4", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 from $0", 
 	ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -721,7 +721,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	strcpy(msg, "fetch :count from");
 	count = 1;
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 from $0", 
+	{ ECPGfetch(":curname4", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 from $0", 
 	ECPGt_int,&(count),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1), 
@@ -738,7 +738,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "move");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "move absolute 0 $0", 
+	{ ECPGfetch(":curname4", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "move absolute 0 $0", 
 	ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 226 "cursor.pgc"
@@ -748,7 +748,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "fetch 1");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 $0", 
+	{ ECPGfetch(":curname4", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 $0", 
 	ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
@@ -764,7 +764,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	strcpy(msg, "fetch :count");
 	count = 1;
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 $0", 
+	{ ECPGfetch(":curname4", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 $0", 
 	ECPGt_int,&(count),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1), 
@@ -781,7 +781,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	printf("%d %s\n", id, t);
 
 	strcpy(msg, "close");
-	{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "close $0", 
+	{ ECPGclose(":curname4", __LINE__, 0, 1, "test1", 0, ECPGst_normal, "close $0", 
 	ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 238 "cursor.pgc"
diff --git a/src/interfaces/ecpg/test/expected/preproc-outofscope.c b/src/interfaces/ecpg/test/expected/preproc-outofscope.c
index 348e843..23ce610 100644
--- a/src/interfaces/ecpg/test/expected/preproc-outofscope.c
+++ b/src/interfaces/ecpg/test/expected/preproc-outofscope.c
@@ -201,7 +201,7 @@ get_var1(MYTYPE **myvar0, MYNULLTYPE **mynullvar0)
 static void
 open_cur1(void)
 {
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur cursor for select * from a1", ECPGt_EOIT, 
+	{ ECPGopen("mycur", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur cursor for select * from a1", ECPGt_EOIT, 
 	ECPGt_int,&((*( MYTYPE  *)(ECPGget_var( 0)) ).id),(long)1,(long)1,sizeof( struct mytype ), 
 	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1)) ).id),(long)1,(long)1,sizeof( struct mynulltype ), 
 	ECPGt_char,&((*( MYTYPE  *)(ECPGget_var( 0)) ).t),(long)64,(long)1,sizeof( struct mytype ), 
@@ -225,7 +225,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 static void
 get_record1(void)
 {
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch mycur", ECPGt_EOIT, 
+	{ ECPGfetch("mycur", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch mycur", ECPGt_EOIT, 
 	ECPGt_int,&((*( MYTYPE  *)(ECPGget_var( 0)) ).id),(long)1,(long)1,sizeof( struct mytype ), 
 	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1)) ).id),(long)1,(long)1,sizeof( struct mynulltype ), 
 	ECPGt_char,&((*( MYTYPE  *)(ECPGget_var( 0)) ).t),(long)64,(long)1,sizeof( struct mytype ), 
@@ -249,7 +249,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 static void
 close_cur1(void)
 {
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("mycur", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur", ECPGt_EOIT, ECPGt_EORT);
 #line 58 "outofscope.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
diff --git a/src/interfaces/ecpg/test/expected/preproc-variable.c b/src/interfaces/ecpg/test/expected/preproc-variable.c
index 7fd03ba..722c02e 100644
--- a/src/interfaces/ecpg/test/expected/preproc-variable.c
+++ b/src/interfaces/ecpg/test/expected/preproc-variable.c
@@ -190,7 +190,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "open");
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select name , born , age , married , children from family", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen("cur", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select name , born , age , married , children from family", ECPGt_EOIT, ECPGt_EORT);
 #line 63 "variable.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
@@ -206,7 +206,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	memset(i, 0, sizeof(ind_personal));
 	while (1) {
 		strcpy(msg, "fetch");
-		{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur", ECPGt_EOIT, 
+		{ ECPGfetch("cur", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur", ECPGt_EOIT, 
 	ECPGt_varchar,&(p->name),(long)BUFFERSIZ,(long)-1,sizeof( struct birthinfo ), 
 	ECPGt_int,&(i->ind_name),(long)1,(long)-1,sizeof( struct birthinfo ), 
 	ECPGt_long,&(p->birth.born),(long)1,(long)1,sizeof( struct birthinfo ), 
@@ -241,7 +241,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	}
 
 	strcpy(msg, "close");
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("cur", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
 #line 89 "variable.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
diff --git a/src/interfaces/ecpg/test/expected/sql-binary.c b/src/interfaces/ecpg/test/expected/sql-binary.c
index b91ab7b..ce64de5 100644
--- a/src/interfaces/ecpg/test/expected/sql-binary.c
+++ b/src/interfaces/ecpg/test/expected/sql-binary.c
@@ -111,12 +111,12 @@ main (void)
  /* declare C cursor for select name , accs , byte from empl where idnum = $1  */
 #line 58 "binary.pgc"
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select name , accs , byte from empl where idnum = $1 ", 
+  { ECPGopen("C", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select name , accs , byte from empl where idnum = $1 ", 
 	ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
 #line 59 "binary.pgc"
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch C", ECPGt_EOIT, 
+  { ECPGfetch("C", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch C", ECPGt_EOIT, 
 	ECPGt_char,(empl.name),(long)21,(long)1,(21)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_short,&(empl.accs),(long)1,(long)1,sizeof(short), 
@@ -133,7 +133,7 @@ main (void)
 
   printf ("name=%s, accs=%d byte=%s\n", empl.name, empl.accs, empl.byte);
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close C", ECPGt_EOIT, ECPGt_EORT);}
+  { ECPGclose("C", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close C", ECPGt_EOIT, ECPGt_EORT);}
 #line 69 "binary.pgc"
 
 
@@ -142,12 +142,12 @@ main (void)
  /* declare B binary cursor for select name , accs , byte from empl where idnum = $1  */
 #line 72 "binary.pgc"
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare B binary cursor for select name , accs , byte from empl where idnum = $1 ", 
+  { ECPGopen("B", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare B binary cursor for select name , accs , byte from empl where idnum = $1 ", 
 	ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
 #line 73 "binary.pgc"
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch B", ECPGt_EOIT, 
+  { ECPGfetch("B", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch B", ECPGt_EOIT, 
 	ECPGt_char,(empl.name),(long)21,(long)1,(21)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_short,&(empl.accs),(long)1,(long)1,sizeof(short), 
@@ -162,7 +162,7 @@ main (void)
       exit (sqlca.sqlcode);
     }
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close B", ECPGt_EOIT, ECPGt_EORT);}
+  { ECPGclose("B", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close B", ECPGt_EOIT, ECPGt_EORT);}
 #line 81 "binary.pgc"
 
 
@@ -176,12 +176,12 @@ main (void)
  /* declare A binary cursor for select byte from empl where idnum = $1  */
 #line 89 "binary.pgc"
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare A binary cursor for select byte from empl where idnum = $1 ", 
+  { ECPGopen("A", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare A binary cursor for select byte from empl where idnum = $1 ", 
 	ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
 #line 90 "binary.pgc"
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch A", ECPGt_EOIT, 
+  { ECPGfetch("A", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch A", ECPGt_EOIT, 
 	ECPGt_char,&(pointer),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
 #line 91 "binary.pgc"
@@ -192,7 +192,7 @@ main (void)
       exit (sqlca.sqlcode);
     }
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close A", ECPGt_EOIT, ECPGt_EORT);}
+  { ECPGclose("A", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close A", ECPGt_EOIT, ECPGt_EORT);}
 #line 98 "binary.pgc"
 
 
diff --git a/src/interfaces/ecpg/test/expected/sql-declare.c b/src/interfaces/ecpg/test/expected/sql-declare.c
new file mode 100644
index 0000000..2a7ea0d
--- /dev/null
+++ b/src/interfaces/ecpg/test/expected/sql-declare.c
@@ -0,0 +1,2592 @@
+/* Processed by ecpg (regression mode) */
+/* These include files are added by the preprocessor */
+#include <ecpglib.h>
+#include <ecpgerrno.h>
+#include <sqlca.h>
+/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
+
+#line 1 "declare.pgc"
+#include <locale.h>
+#include <string.h>
+#include <stdlib.h>
+
+/* exec sql whenever sqlerror  sqlprint ; */
+#line 5 "declare.pgc"
+
+
+
+#line 1 "sqlca.h"
+#ifndef POSTGRES_SQLCA_H
+#define POSTGRES_SQLCA_H
+
+#ifndef PGDLLIMPORT
+#if  defined(WIN32) || defined(__CYGWIN__)
+#define PGDLLIMPORT __declspec (dllimport)
+#else
+#define PGDLLIMPORT
+#endif   /* __CYGWIN__ */
+#endif   /* PGDLLIMPORT */
+
+#define SQLERRMC_LEN	150
+
+#ifdef __cplusplus
+extern		"C"
+{
+#endif
+
+struct sqlca_t
+{
+	char		sqlcaid[8];
+	long		sqlabc;
+	long		sqlcode;
+	struct
+	{
+		int			sqlerrml;
+		char		sqlerrmc[SQLERRMC_LEN];
+	}			sqlerrm;
+	char		sqlerrp[8];
+	long		sqlerrd[6];
+	/* Element 0: empty						*/
+	/* 1: OID of processed tuple if applicable			*/
+	/* 2: number of rows processed				*/
+	/* after an INSERT, UPDATE or				*/
+	/* DELETE statement					*/
+	/* 3: empty						*/
+	/* 4: empty						*/
+	/* 5: empty						*/
+	char		sqlwarn[8];
+	/* Element 0: set to 'W' if at least one other is 'W'	*/
+	/* 1: if 'W' at least one character string		*/
+	/* value was truncated when it was			*/
+	/* stored into a host variable.             */
+
+	/*
+	 * 2: if 'W' a (hopefully) non-fatal notice occurred
+	 */	/* 3: empty */
+	/* 4: empty						*/
+	/* 5: empty						*/
+	/* 6: empty						*/
+	/* 7: empty						*/
+
+	char		sqlstate[5];
+};
+
+struct sqlca_t *ECPGget_sqlca(void);
+
+#ifndef POSTGRES_ECPG_INTERNAL
+#define sqlca (*ECPGget_sqlca())
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#line 7 "declare.pgc"
+
+
+#line 1 "regression.h"
+
+
+
+
+
+
+#line 8 "declare.pgc"
+
+
+#define OUT_ARRAY_SZIE 20
+#define TEST_CASE_NUM 29
+#define COLUMN_NUM 3
+#define FIELD_NAME_LEN 30
+
+void declare_test(char * tc_name);
+int createTable(void);
+void dropTable(void);
+void reCreateTable(void);
+void truncateTable(void);
+void commitTable(void);
+void reset(void);
+int initValues(void);
+void releaseValues(void);
+void printResultF123(char *tc_name, int loop);
+void printResultIndF123(char *tc_name, int loop);
+int startManualTest(char *in);
+int startAutoTest(void);
+void printFieldName(char *);
+
+/* exec sql begin declare section */
+
+    //input variables
+                
+            
+              
+
+    //output variables
+     
+     
+     
+
+     
+
+
+     
+
+
+#line 33 "declare.pgc"
+ int in_f1 = 1 ;
+ 
+#line 34 "declare.pgc"
+ double in_f2 = 10 ;
+ 
+#line 35 "declare.pgc"
+ char in_f3 [ 20 ] = { "one" } ;
+ 
+#line 38 "declare.pgc"
+ int f1 [ OUT_ARRAY_SZIE ] ;
+ 
+#line 39 "declare.pgc"
+ int f2 [ OUT_ARRAY_SZIE ] ;
+ 
+#line 40 "declare.pgc"
+ char f3 [ OUT_ARRAY_SZIE ] [ 20 ] ;
+ 
+#line 42 "declare.pgc"
+ char field_name [ COLUMN_NUM ] [ FIELD_NAME_LEN ] ;
+ 
+#line 45 "declare.pgc"
+ int ind_f1 [ OUT_ARRAY_SZIE ] , ind_f2 [ OUT_ARRAY_SZIE ] , ind_f3 [ OUT_ARRAY_SZIE ] ;
+/* exec sql end declare section */
+#line 47 "declare.pgc"
+
+
+int
+main (int argc, char *argv[])
+{
+    setlocale(LC_ALL, "C");
+
+    ECPGdebug(1, stderr);
+
+    /* connect to database */
+    { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "con1", 0); 
+#line 57 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 57 "declare.pgc"
+
+    { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "con2", 0); 
+#line 58 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 58 "declare.pgc"
+
+    { ECPGconnect(__LINE__, 0, "ecpg3_regression" , NULL, NULL , "con3", 0); 
+#line 59 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 59 "declare.pgc"
+
+
+    if(initValues())
+    {
+        printf("Error: initValues return error!\n");
+
+        releaseValues();
+        return -1;
+    }
+
+    if(argc == 2) //start manual test
+    {
+        printf("Start manual test! \n");
+        startManualTest(argv[1]);
+    }
+    else  //start auto test
+    {
+        startAutoTest();
+    }
+
+    { ECPGdisconnect(__LINE__, "con1");
+#line 79 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 79 "declare.pgc"
+
+
+    { ECPGdisconnect(__LINE__, "ALL");
+#line 81 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 81 "declare.pgc"
+
+
+    releaseValues();
+
+    return (0);
+}
+
+int startManualTest(char *in)
+{
+    if(!strcmp(in,"cr"))
+    {
+        createTable();
+    }
+    else if(!strcmp(in,"dr"))
+    {
+        dropTable();
+    }
+    else if(!strcmp(in,"re"))
+    {
+        reCreateTable();
+    }
+    else if(!strcmp(in,"help"))
+    {
+        printf("====Supporting the following parameters====\n");
+        printf("1. cr -- create tables\n");
+        printf("2. dr -- drop tables\n");
+        printf("3. re -- drop tables and create tables\n");
+        printf("4. testcaseX where X is a digit form 1 to %d\n",TEST_CASE_NUM);
+        printf("If you don't give any parameter, the program will start the test from the testcase1 to testcase%d automatically\n",TEST_CASE_NUM);
+    }
+    else
+    {
+        declare_test(in);
+    }
+
+    commitTable();
+
+    return 0;
+}
+
+int startAutoTest()
+{
+    int i;
+    char tc_name[20];
+
+    dropTable();
+
+    if(createTable())
+    {
+        printf("Error: createTable return error!\n");
+        return -1;
+    }
+
+    for(i=1;i<=TEST_CASE_NUM;i++)
+    {
+        sprintf(tc_name,"testcase%d",i);
+        declare_test(tc_name);
+    }
+
+    dropTable();
+
+    return 0;
+}
+
+
+/*
+ * default connection: con3
+ * Non-default connection: con1, con2
+ *
+ * testcase1. using DECLARE STATEMENT, let CURSOR statement precede PREPARE statement
+ *        ---test result: ok
+ * testcase2. without using DECLARE STATEMENT, let CURSOR statement precede PREPARE statement
+ *        ---test result: ok
+ *
+ * testcase3. using DECLARE STATEMENT at con1, using PREPARE and EXECUTE statement without using AT clause
+ *        ---test result: ok
+ * testcase4. using DECLARE STATEMENT at con1, using PREPARE and EXECUTE statement at con2
+ *        ---test result: ok
+ * testcase5. using DECLARE STATEMENT at con1, using PREPARE and CURSOR statement without using AT clause
+ *        ---test result: ok
+ * testcase6. using DECLARE STATEMENT at con1, using PREPARE and CURSOR statement at con2
+ *        ---test result: ok
+ * testcase7. using DECLARE STATEMENT at con1, using DESCRIBE statement without using AT clause
+ *        ---test result: ok
+ * testcase8. using DECLARE STATEMENT at con1, using DESCRIBE statement at con2
+ *        ---test result: ok
+ *
+ * testcase9. using DECLARE STATEMENT at con3, using PREPARE and EXECUTE statement without using AT clause
+ *        ---test result: ok
+ * testcase10. using DECLARE STATEMENT at con3, using PREPARE and EXECUTE statement at con2
+ *        ---test result: ok
+ * testcase11. using DECLARE STATEMENT at con3, using PREPARE and CURSOR statement without using AT clause
+ *        ---test result: ok
+ * testcase12. using DECLARE STATEMENT at con3, using PREPARE and CURSOR statement at con2
+ *        ---test result: ok
+ * testcase13. using DECLARE STATEMENT at con3, using DESCRIBE statement without using AT clause
+ *        ---test result: ok
+ * testcase14. using DECLARE STATEMENT at con3, using DESCRIBE statement at con2
+ *        ---test result: ok
+ *
+ * testcase15. using DECLARE STATEMENT without using AT clause, using PREPARE and EXECUTE statement without using AT clause
+ *        ---test result: ok
+ * testcase16. using DECLARE STATEMENT without using AT clause, using PREPARE and EXECUTE statement at con2
+ *        ---test result: ok
+ * testcase17. using DECLARE STATEMENT without using AT clause, using PREPARE and CURSOR statement without using AT clause
+ *        ---test result: ok
+ * testcase18. using DECLARE STATEMENT without using AT clause, using PREPARE and CURSOR statement at con2
+ *        ---test result: ok
+ * testcase19. using DECLARE STATEMENT without using AT clause, using DESCRIBE statement without using AT clause
+ *        ---test result: ok
+ * testcase20. using DECLARE STATEMENT without using AT clause, using DESCRIBE statement at con2
+ *        ---test result: ok
+
+ * testcase21. using DECLARE STATEMENT at con1, using PREPARE and EXECUTE statement at con2
+ *            using quoted string as declared name
+ *        ---test result: ok
+ * testcase22. using DECLARE STATEMENT at con1, using PREPARE and CURSOR statement at con2
+ *            using quoted string as declared name
+ *        ---test result: ok
+ * testcase23. using DECLARE STATEMENT at con1, using DESCRIBE statement at con2
+ *            using quoted string as declared name
+ *        ---test result: ok
+ *
+ * testcase24. using DECLARE STATEMENT at con1, using PREPARE and EXECUTE statement at con2
+ *            using host variable as declared name
+ *        ---test result:
+ *
+ * testcase25. using DECLARE STATEMENT at con1, using PREPARE and EXECUTE statement at con2 and without referring the DECLARE statement
+ *        ---test result: ok
+ * testcase26. using DECLARE STATEMENT at con1, using PREPARE and CURSOR statement at con2 and without referring the DECLARE statement
+ *        ---test result: ok
+ * testcase27. using DECLARE STATEMENT at con1, using PREPARE and DESCRIBE statement at con2 and without referring the DECLARE statement
+ *        ---test result: ok
+ *
+ * testcase28. Using host variable as cursor name in the DECLARE/OPEN CURSOR statement,
+ *             using the content in the host variable as the cursor name in the CLOSE CURSOR statement
+ *             This is nothing with DECLARE STATEMENT feature, this case just verify a bug that cursor name can be closed by using
+ *             content of host variable while the cursor name is declared/opened by using the host variable.
+ *        ---test result: ok
+ *
+ * testcase29. using DECLARE STATEMENT at con1, using PREPARE and CURSOR statement without using AT clause
+ *             one cursor is set to "open" and "close" twice.
+ *             Check the declared name can be referred by the cursor at the second time correctly
+ *        ---test result: ok
+ */
+void declare_test(char * tc_name)
+{
+    /* exec sql begin declare section */
+     
+
+          
+          
+
+          
+          
+          
+
+          
+
+          
+
+    
+#line 229 "declare.pgc"
+ int i ;
+ 
+#line 231 "declare.pgc"
+ char * selectString = "SELECT f1,f2,f3 FROM source where f1<4" ;
+ 
+#line 232 "declare.pgc"
+ char * selectTb1 = "SELECT * FROM tb1" ;
+ 
+#line 234 "declare.pgc"
+ char * stmt_4 = "str_stmt_4" ;
+ 
+#line 235 "declare.pgc"
+ char * stmt_6 = "str_stmt_6" ;
+ 
+#line 236 "declare.pgc"
+ char * stmt_8 = "str_stmt_8" ;
+ 
+#line 238 "declare.pgc"
+ char * cur_6 = "str_cur_6" ;
+ 
+#line 240 "declare.pgc"
+ char * desc_8 = "str_desc_8" ;
+/* exec sql end declare section */
+#line 242 "declare.pgc"
+
+
+    if(!strcmp(tc_name,"testcase1"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, NULL, "stmt_1");
+#line 248 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 248 "declare.pgc"
+
+        /* declare cur_1 cursor for $1 */
+#line 249 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_1", selectString);
+#line 250 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 250 "declare.pgc"
+
+        { ECPGopen("cur_1", "stmt_1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur_1 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement(NULL, "stmt_1", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 251 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 251 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 253 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur_1", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 257 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 257 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 257 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur_1", ECPGt_EOIT, ECPGt_EORT);
+#line 261 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 261 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_1");
+#line 262 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 262 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase2"))
+    {
+        reset();
+
+        /* declare cur_2 cursor for $1 */
+#line 270 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_2", selectString);
+#line 271 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 271 "declare.pgc"
+
+        { ECPGopen("cur_2", "stmt_2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur_2 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement(NULL, "stmt_2", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 272 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 272 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 274 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur_2", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 278 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 278 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 278 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur_2", ECPGt_EOIT, ECPGt_EORT);
+#line 282 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 282 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_2");
+#line 283 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 283 "declare.pgc"
+
+
+        /* exec sql whenever not found  continue ; */
+#line 285 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase3"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_3");
+#line 293 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 293 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_3", selectString);
+#line 294 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 294 "declare.pgc"
+
+        { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "stmt_3", ECPGt_EOIT, 
+	ECPGt_int,(f1),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,(f2),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3),(long)20,(long)OUT_ARRAY_SZIE,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 295 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 295 "declare.pgc"
+
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_3");
+#line 297 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 297 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase4"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_4");
+#line 305 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 305 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_4", selectString);
+#line 306 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 306 "declare.pgc"
+
+        { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_execute, "stmt_4", ECPGt_EOIT, 
+	ECPGt_int,(f1),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,(f2),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3),(long)20,(long)OUT_ARRAY_SZIE,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 307 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 307 "declare.pgc"
+
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_4");
+#line 309 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 309 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", stmt_4);
+#line 315 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 315 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, stmt_4, selectString);
+#line 316 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 316 "declare.pgc"
+
+        { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_execute, stmt_4, ECPGt_EOIT, 
+	ECPGt_int,(f1),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,(f2),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3),(long)20,(long)OUT_ARRAY_SZIE,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 317 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 317 "declare.pgc"
+
+
+        { ECPGdeallocate(__LINE__, 0, NULL, stmt_4);
+#line 319 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 319 "declare.pgc"
+
+
+        printResultF123(NULL,3);
+    }
+    else if(!strcmp(tc_name,"testcase5"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_5");
+#line 327 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 327 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_5", selectString);
+#line 328 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 328 "declare.pgc"
+
+        /* declare cur_5 cursor for $1 */
+#line 329 "declare.pgc"
+
+        { ECPGopen("cur_5", "stmt_5", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur_5 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement(NULL, "stmt_5", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 330 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 330 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 332 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_5", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur_5", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 336 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 336 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 336 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_5", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur_5", ECPGt_EOIT, ECPGt_EORT);
+#line 340 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 340 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_5");
+#line 341 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 341 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase6"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_6");
+#line 349 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 349 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_6", selectString);
+#line 350 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 350 "declare.pgc"
+
+        /* declare cur_6 cursor for $1 */
+#line 351 "declare.pgc"
+
+        { ECPGopen("cur_6", "stmt_6", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "declare cur_6 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement("con2", "stmt_6", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 352 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 352 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 354 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_6", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "fetch cur_6", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 358 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 358 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 358 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_6", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "close cur_6", ECPGt_EOIT, ECPGt_EORT);
+#line 362 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 362 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_6");
+#line 363 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 363 "declare.pgc"
+
+        /* exec sql whenever not found  continue ; */
+#line 364 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", stmt_6);
+#line 370 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 370 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, stmt_6, selectString);
+#line 371 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 371 "declare.pgc"
+
+        ECPGset_var( 0, &( cur_6 ), __LINE__);\
+ /* declare $0 cursor for $1 */
+#line 372 "declare.pgc"
+
+        { ECPGopen(":cur_6", stmt_6, __LINE__, 0, 1, "con2", 0, ECPGst_normal, "declare $0 cursor for $1", 
+	ECPGt_char,&(cur_6),(long)0,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char_variable,(ECPGprepared_statement("con2", stmt_6, __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 373 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 373 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 375 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch(":cur_6", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "fetch $0", 
+	ECPGt_char,&(cur_6),(long)0,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 379 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 379 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 379 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose(":cur_6", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "close $0", 
+	ECPGt_char,&(cur_6),(long)0,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 383 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 383 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", stmt_6);
+#line 384 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 384 "declare.pgc"
+
+        /* exec sql whenever not found  continue ; */
+#line 385 "declare.pgc"
+
+
+        printResultF123(NULL,3);
+    }
+    else if(!strcmp(tc_name,"testcase7"))
+    {
+        reset();
+
+        ECPGallocate_desc(__LINE__, "desc_7");
+#line 393 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 393 "declare.pgc"
+
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_7");
+#line 395 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 395 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_7", selectTb1);
+#line 396 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 396 "declare.pgc"
+
+        { ECPGdescribe(__LINE__, 0, 0, NULL, "stmt_7",
+	ECPGt_descriptor, "desc_7", 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
+#line 397 "declare.pgc"
+
+
+        for(i=1; i<4; i++)
+        {
+            { ECPGget_desc(__LINE__, "desc_7", i,ECPGd_name,
+	ECPGt_char,(field_name[i-1]),(long)FIELD_NAME_LEN,(long)1,(FIELD_NAME_LEN)*sizeof(char), ECPGd_EODT);
+
+#line 401 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 401 "declare.pgc"
+
+        }
+
+        ECPGdeallocate_desc(__LINE__, "desc_7");
+#line 404 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 404 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_7");
+#line 405 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 405 "declare.pgc"
+
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase8"))
+    {
+        reset();
+
+        ECPGallocate_desc(__LINE__, "desc_8");
+#line 413 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 413 "declare.pgc"
+
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_8");
+#line 415 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 415 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_8", selectTb1);
+#line 416 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 416 "declare.pgc"
+
+        { ECPGdescribe(__LINE__, 0, 0, "con2", "stmt_8",
+	ECPGt_descriptor, "desc_8", 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
+#line 417 "declare.pgc"
+
+
+        for(i=1; i<4; i++)
+        {
+            { ECPGget_desc(__LINE__, "desc_8", i,ECPGd_name,
+	ECPGt_char,(field_name[i-1]),(long)FIELD_NAME_LEN,(long)1,(FIELD_NAME_LEN)*sizeof(char), ECPGd_EODT);
+
+#line 421 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 421 "declare.pgc"
+
+        }
+
+        ECPGdeallocate_desc(__LINE__, "desc_8");
+#line 424 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 424 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_8");
+#line 425 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 425 "declare.pgc"
+
+
+        printFieldName(tc_name);
+
+
+        reset();
+
+        ECPGallocate_desc(__LINE__, (desc_8));
+#line 432 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 432 "declare.pgc"
+
+
+        { ECPGdeclare(__LINE__, "con1", stmt_8);
+#line 434 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 434 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, stmt_8, selectTb1);
+#line 435 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 435 "declare.pgc"
+
+        { ECPGdescribe(__LINE__, 0, 0, "con2", stmt_8,
+	ECPGt_descriptor, (desc_8), 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
+#line 436 "declare.pgc"
+
+
+        for(i=1; i<4; i++)
+        {
+            { ECPGget_desc(__LINE__, (desc_8), i,ECPGd_name,
+	ECPGt_char,(field_name[i-1]),(long)FIELD_NAME_LEN,(long)1,(FIELD_NAME_LEN)*sizeof(char), ECPGd_EODT);
+
+#line 440 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 440 "declare.pgc"
+
+        }
+
+        ECPGdeallocate_desc(__LINE__, (desc_8));
+#line 443 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 443 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", stmt_8);
+#line 444 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 444 "declare.pgc"
+
+
+        printFieldName(NULL);
+    }
+    else if(!strcmp(tc_name,"testcase9"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con3", "stmt_9");
+#line 452 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 452 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_9", selectString);
+#line 453 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 453 "declare.pgc"
+
+        { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "stmt_9", ECPGt_EOIT, 
+	ECPGt_int,(f1),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,(f2),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3),(long)20,(long)OUT_ARRAY_SZIE,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 454 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 454 "declare.pgc"
+
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_9");
+#line 456 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 456 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase10"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con3", "stmt_10");
+#line 464 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 464 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_10", selectString);
+#line 465 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 465 "declare.pgc"
+
+        { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_execute, "stmt_10", ECPGt_EOIT, 
+	ECPGt_int,(f1),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,(f2),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3),(long)20,(long)OUT_ARRAY_SZIE,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 466 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 466 "declare.pgc"
+
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_10");
+#line 468 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 468 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase11"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con3", "stmt_11");
+#line 476 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 476 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_11", selectString);
+#line 477 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 477 "declare.pgc"
+
+        /* declare cur_11 cursor for $1 */
+#line 478 "declare.pgc"
+
+        { ECPGopen("cur_11", "stmt_11", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur_11 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement(NULL, "stmt_11", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 479 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 479 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 481 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_11", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur_11", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 485 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 485 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 485 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_11", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur_11", ECPGt_EOIT, ECPGt_EORT);
+#line 489 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 489 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_11");
+#line 490 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 490 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase12"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con3", "stmt_12");
+#line 498 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 498 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_12", selectString);
+#line 499 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 499 "declare.pgc"
+
+        /* declare cur_12 cursor for $1 */
+#line 500 "declare.pgc"
+
+        { ECPGopen("cur_12", "stmt_12", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "declare cur_12 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement("con2", "stmt_12", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 501 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 501 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 503 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_12", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "fetch cur_12", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 507 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 507 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 507 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_12", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "close cur_12", ECPGt_EOIT, ECPGt_EORT);
+#line 511 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 511 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_12");
+#line 512 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 512 "declare.pgc"
+
+        /* exec sql whenever not found  continue ; */
+#line 513 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase13"))
+    {
+        reset();
+
+        ECPGallocate_desc(__LINE__, "desc_13");
+#line 521 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 521 "declare.pgc"
+
+
+        { ECPGdeclare(__LINE__, "con3", "stmt_13");
+#line 523 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 523 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_13", selectTb1);
+#line 524 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 524 "declare.pgc"
+
+        { ECPGdescribe(__LINE__, 0, 0, NULL, "stmt_13",
+	ECPGt_descriptor, "desc_13", 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
+#line 525 "declare.pgc"
+
+
+        for(i=1; i<4; i++)
+        {
+            { ECPGget_desc(__LINE__, "desc_13", i,ECPGd_name,
+	ECPGt_char,(field_name[i-1]),(long)FIELD_NAME_LEN,(long)1,(FIELD_NAME_LEN)*sizeof(char), ECPGd_EODT);
+
+#line 529 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 529 "declare.pgc"
+
+        }
+
+        ECPGdeallocate_desc(__LINE__, "desc_13");
+#line 532 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 532 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_13");
+#line 533 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 533 "declare.pgc"
+
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase14"))
+    {
+        reset();
+
+        ECPGallocate_desc(__LINE__, "desc_14");
+#line 541 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 541 "declare.pgc"
+
+
+        { ECPGdeclare(__LINE__, "con3", "stmt_14");
+#line 543 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 543 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_14", selectTb1);
+#line 544 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 544 "declare.pgc"
+
+        { ECPGdescribe(__LINE__, 0, 0, "con2", "stmt_14",
+	ECPGt_descriptor, "desc_14", 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
+#line 545 "declare.pgc"
+
+
+        for(i=1; i<4; i++)
+        {
+            { ECPGget_desc(__LINE__, "desc_14", i,ECPGd_name,
+	ECPGt_char,(field_name[i-1]),(long)FIELD_NAME_LEN,(long)1,(FIELD_NAME_LEN)*sizeof(char), ECPGd_EODT);
+
+#line 549 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 549 "declare.pgc"
+
+        }
+
+        ECPGdeallocate_desc(__LINE__, "desc_14");
+#line 552 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 552 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_14");
+#line 553 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 553 "declare.pgc"
+
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase15"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, NULL, "stmt_15");
+#line 561 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 561 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_15", selectString);
+#line 562 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 562 "declare.pgc"
+
+        { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "stmt_15", ECPGt_EOIT, 
+	ECPGt_int,(f1),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,(f2),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3),(long)20,(long)OUT_ARRAY_SZIE,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 563 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 563 "declare.pgc"
+
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_15");
+#line 565 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 565 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase16"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, NULL, "stmt_16");
+#line 573 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 573 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_16", selectString);
+#line 574 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 574 "declare.pgc"
+
+        { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_execute, "stmt_16", ECPGt_EOIT, 
+	ECPGt_int,(f1),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,(f2),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3),(long)20,(long)OUT_ARRAY_SZIE,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 575 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 575 "declare.pgc"
+
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_16");
+#line 577 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 577 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase17"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, NULL, "stmt_17");
+#line 585 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 585 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_17", selectString);
+#line 586 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 586 "declare.pgc"
+
+        /* declare cur_17 cursor for $1 */
+#line 587 "declare.pgc"
+
+        { ECPGopen("cur_17", "stmt_17", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur_17 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement(NULL, "stmt_17", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 588 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 588 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 590 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_17", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur_17", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 594 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 594 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 594 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_17", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur_17", ECPGt_EOIT, ECPGt_EORT);
+#line 598 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 598 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_17");
+#line 599 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 599 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase18"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, NULL, "stmt_18");
+#line 607 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 607 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_18", selectString);
+#line 608 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 608 "declare.pgc"
+
+        /* declare cur_18 cursor for $1 */
+#line 609 "declare.pgc"
+
+        { ECPGopen("cur_18", "stmt_18", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "declare cur_18 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement("con2", "stmt_18", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 610 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 610 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 612 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_18", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "fetch cur_18", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 616 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 616 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 616 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_18", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "close cur_18", ECPGt_EOIT, ECPGt_EORT);
+#line 620 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 620 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_18");
+#line 621 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 621 "declare.pgc"
+
+        /* exec sql whenever not found  continue ; */
+#line 622 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase19"))
+    {
+        reset();
+
+        ECPGallocate_desc(__LINE__, "desc_19");
+#line 630 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 630 "declare.pgc"
+
+
+        { ECPGdeclare(__LINE__, NULL, "stmt_19");
+#line 632 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 632 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_19", selectTb1);
+#line 633 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 633 "declare.pgc"
+
+        { ECPGdescribe(__LINE__, 0, 0, NULL, "stmt_19",
+	ECPGt_descriptor, "desc_19", 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
+#line 634 "declare.pgc"
+
+
+        for(i=1; i<4; i++)
+        {
+            { ECPGget_desc(__LINE__, "desc_19", i,ECPGd_name,
+	ECPGt_char,(field_name[i-1]),(long)FIELD_NAME_LEN,(long)1,(FIELD_NAME_LEN)*sizeof(char), ECPGd_EODT);
+
+#line 638 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 638 "declare.pgc"
+
+        }
+
+        ECPGdeallocate_desc(__LINE__, "desc_19");
+#line 641 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 641 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_19");
+#line 642 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 642 "declare.pgc"
+
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase20"))
+    {
+        reset();
+
+        ECPGallocate_desc(__LINE__, "desc_20");
+#line 650 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 650 "declare.pgc"
+
+
+        { ECPGdeclare(__LINE__, NULL, "stmt_20");
+#line 652 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 652 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_20", selectTb1);
+#line 653 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 653 "declare.pgc"
+
+        { ECPGdescribe(__LINE__, 0, 0, "con2", "stmt_20",
+	ECPGt_descriptor, "desc_20", 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
+#line 654 "declare.pgc"
+
+
+        for(i=1; i<4; i++)
+        {
+            { ECPGget_desc(__LINE__, "desc_20", i,ECPGd_name,
+	ECPGt_char,(field_name[i-1]),(long)FIELD_NAME_LEN,(long)1,(FIELD_NAME_LEN)*sizeof(char), ECPGd_EODT);
+
+#line 658 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 658 "declare.pgc"
+
+        }
+
+        ECPGdeallocate_desc(__LINE__, "desc_20");
+#line 661 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 661 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_20");
+#line 662 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 662 "declare.pgc"
+
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase21"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_21");
+#line 670 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 670 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_21", selectString);
+#line 671 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 671 "declare.pgc"
+
+        { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_execute, "stmt_21", ECPGt_EOIT, 
+	ECPGt_int,(f1),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,(f2),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3),(long)20,(long)OUT_ARRAY_SZIE,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 672 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 672 "declare.pgc"
+
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_21");
+#line 674 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 674 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase22"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_22");
+#line 682 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 682 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_22", selectString);
+#line 683 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 683 "declare.pgc"
+
+        /* declare \"cur_22\" cursor for $1 */
+#line 684 "declare.pgc"
+
+        { ECPGopen("\"cur_22\"", "stmt_22", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "declare \"cur_22\" cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement("con2", "stmt_22", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 685 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 685 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 687 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("\"cur_22\"", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "fetch \"cur_22\"", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 691 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 691 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 691 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("\"cur_22\"", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "close \"cur_22\"", ECPGt_EOIT, ECPGt_EORT);
+#line 695 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 695 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_22");
+#line 696 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 696 "declare.pgc"
+
+        /* exec sql whenever not found  continue ; */
+#line 697 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase23"))
+    {
+        reset();
+
+        ECPGallocate_desc(__LINE__, "desc_23");
+#line 705 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 705 "declare.pgc"
+
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_23");
+#line 707 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 707 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_23", selectTb1);
+#line 708 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 708 "declare.pgc"
+
+        { ECPGdescribe(__LINE__, 0, 0, "con2", "stmt_23",
+	ECPGt_descriptor, "desc_23", 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
+#line 709 "declare.pgc"
+
+
+        for(i=1; i<4; i++)
+        {
+            { ECPGget_desc(__LINE__, "desc_23", i,ECPGd_name,
+	ECPGt_char,(field_name[i-1]),(long)FIELD_NAME_LEN,(long)1,(FIELD_NAME_LEN)*sizeof(char), ECPGd_EODT);
+
+#line 713 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 713 "declare.pgc"
+
+        }
+
+        ECPGdeallocate_desc(__LINE__, "desc_23");
+#line 716 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 716 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_23");
+#line 717 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 717 "declare.pgc"
+
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase24"))
+    {
+        /* exec sql begin declare section */
+           
+        
+#line 724 "declare.pgc"
+ char * char_stmt_24 = "strSTMT24" ;
+/* exec sql end declare section */
+#line 725 "declare.pgc"
+
+
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", char_stmt_24);
+#line 729 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 729 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, char_stmt_24, selectString);
+#line 730 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 730 "declare.pgc"
+
+        { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_execute, char_stmt_24, ECPGt_EOIT, 
+	ECPGt_int,(f1),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,(f2),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3),(long)20,(long)OUT_ARRAY_SZIE,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 731 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 731 "declare.pgc"
+
+
+        { ECPGdeallocate(__LINE__, 0, NULL, char_stmt_24);
+#line 733 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 733 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase25"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_25");
+#line 741 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 741 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "pre_stmt_25", selectString);
+#line 742 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 742 "declare.pgc"
+
+        { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_execute, "pre_stmt_25", ECPGt_EOIT, 
+	ECPGt_int,(f1),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,(f2),(long)1,(long)OUT_ARRAY_SZIE,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3),(long)20,(long)OUT_ARRAY_SZIE,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 743 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 743 "declare.pgc"
+
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "pre_stmt_25");
+#line 745 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 745 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase26"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_26");
+#line 753 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 753 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "pre_stmt_26", selectString);
+#line 754 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 754 "declare.pgc"
+
+        /* declare cur_26 cursor for $1 */
+#line 755 "declare.pgc"
+
+        { ECPGopen("cur_26", "pre_stmt_26", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "declare cur_26 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement("con2", "pre_stmt_26", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 756 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 756 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 758 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_26", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "fetch cur_26", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 762 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 762 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 762 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_26", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "close cur_26", ECPGt_EOIT, ECPGt_EORT);
+#line 766 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 766 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "pre_stmt_26");
+#line 767 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 767 "declare.pgc"
+
+        /* exec sql whenever not found  continue ; */
+#line 768 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase27"))
+    {
+        reset();
+
+        ECPGallocate_desc(__LINE__, "desc_27");
+#line 776 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 776 "declare.pgc"
+
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_27");
+#line 778 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 778 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "pre_stmt_27", selectTb1);
+#line 779 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 779 "declare.pgc"
+
+        { ECPGdescribe(__LINE__, 0, 0, "con2", "pre_stmt_27",
+	ECPGt_descriptor, "desc_27", 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
+#line 780 "declare.pgc"
+
+
+        for(i=1; i<4; i++)
+        {
+            { ECPGget_desc(__LINE__, "desc_27", i,ECPGd_name,
+	ECPGt_char,(field_name[i-1]),(long)FIELD_NAME_LEN,(long)1,(FIELD_NAME_LEN)*sizeof(char), ECPGd_EODT);
+
+#line 784 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 784 "declare.pgc"
+
+        }
+
+        ECPGdeallocate_desc(__LINE__, "desc_27");
+#line 787 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();
+#line 787 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "pre_stmt_27");
+#line 788 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 788 "declare.pgc"
+
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase28"))
+    {
+        /* exec sql begin declare section */
+              
+        
+#line 795 "declare.pgc"
+ char * cur_28 = "str_cur_28" ;
+/* exec sql end declare section */
+#line 796 "declare.pgc"
+
+
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_28");
+#line 800 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 800 "declare.pgc"
+
+        { ECPGprepare(__LINE__, "con2", 0, "stmt_28", selectString);
+#line 801 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 801 "declare.pgc"
+
+        ECPGset_var( 1, &( cur_28 ), __LINE__);\
+ /* declare $0 cursor for $1 */
+#line 802 "declare.pgc"
+
+        { ECPGopen(":cur_28", "stmt_28", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "declare $0 cursor for $1", 
+	ECPGt_char,&(cur_28),(long)0,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char_variable,(ECPGprepared_statement("con2", "stmt_28", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 803 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 803 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 805 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch(":cur_28", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "fetch $0", 
+	ECPGt_char,&(cur_28),(long)0,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 809 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 809 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 809 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("str_cur_28", __LINE__, 0, 1, "con2", 0, ECPGst_normal, "close str_cur_28", ECPGt_EOIT, ECPGt_EORT);
+#line 813 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 813 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, "con2", "stmt_28");
+#line 814 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 814 "declare.pgc"
+
+        /* exec sql whenever not found  continue ; */
+#line 815 "declare.pgc"
+
+
+        printResultF123(tc_name,3);
+
+    }
+    else if(!strcmp(tc_name,"testcase29"))
+    {
+        reset();
+
+        { ECPGdeclare(__LINE__, "con1", "stmt_29");
+#line 824 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 824 "declare.pgc"
+
+        { ECPGprepare(__LINE__, NULL, 0, "stmt_29", selectString);
+#line 825 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 825 "declare.pgc"
+
+        /* declare cur_29 cursor for $1 */
+#line 826 "declare.pgc"
+
+
+        { ECPGopen("cur_29", "stmt_29", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur_29 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement(NULL, "stmt_29", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 828 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 828 "declare.pgc"
+
+
+        /* exec sql whenever not found  break ; */
+#line 830 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_29", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur_29", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 834 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 834 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 834 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_29", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur_29", ECPGt_EOIT, ECPGt_EORT);
+#line 838 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 838 "declare.pgc"
+
+        printResultF123(tc_name,3);
+
+        reset();
+        /* Open and fetch cursor again */
+        { ECPGopen("cur_29", "stmt_29", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur_29 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement(NULL, "stmt_29", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+#line 843 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 843 "declare.pgc"
+
+        i = 0;
+        while(1)
+        {
+            { ECPGfetch("cur_29", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur_29", ECPGt_EOIT, 
+	ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
+	ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+#line 847 "declare.pgc"
+
+if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
+#line 847 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 847 "declare.pgc"
+
+            i++;
+        }
+
+        { ECPGclose("cur_29", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur_29", ECPGt_EOIT, ECPGt_EORT);
+#line 851 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 851 "declare.pgc"
+
+        { ECPGdeallocate(__LINE__, 0, NULL, "stmt_29");
+#line 852 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 852 "declare.pgc"
+
+        /* exec sql whenever not found  continue ; */
+#line 853 "declare.pgc"
+
+
+        printResultF123(NULL,3);
+    }
+    else
+    {
+        /* exec sql whenever not found  continue ; */
+#line 859 "declare.pgc"
+
+        printf("Sorry, there isn't this testcase: %s!\n",tc_name);
+    }
+}
+
+
+/*
+ * success -- 0
+ * failed -- -1
+ */
+int createTable()
+{
+    { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "create table source ( f1 integer , f2 integer , f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
+#line 871 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 871 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "create table source ( f1 integer , f2 integer , f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
+#line 872 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 872 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con3", 0, ECPGst_normal, "create table source ( f1 integer , f2 integer , f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
+#line 873 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 873 "declare.pgc"
+
+
+    { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "create table tb1 ( con1_f1 integer , con1_f2 integer , con1_f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
+#line 875 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 875 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "create table tb1 ( con2_f1 integer , con2_f2 integer , con2_f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
+#line 876 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 876 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con3", 0, ECPGst_normal, "create table tb1 ( con3_f1 integer , con3_f2 integer , con3_f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
+#line 877 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 877 "declare.pgc"
+
+
+    { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "create table target ( f1 integer , f2 integer , f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
+#line 879 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 879 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "create table target ( f1 integer , f2 integer , f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
+#line 880 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 880 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con3", 0, ECPGst_normal, "create table target ( f1 integer , f2 integer , f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
+#line 881 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 881 "declare.pgc"
+
+
+
+
+    { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "insert into source values ( 1 , 10 , 'db on con1' )", ECPGt_EOIT, ECPGt_EORT);
+#line 885 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 885 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "insert into source values ( 2 , 20 , 'db on con1' )", ECPGt_EOIT, ECPGt_EORT);
+#line 886 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 886 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "insert into source values ( 3 , 30 , 'db on con1' )", ECPGt_EOIT, ECPGt_EORT);
+#line 887 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 887 "declare.pgc"
+
+
+    { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "insert into source values ( 1 , 10 , 'db on con2' )", ECPGt_EOIT, ECPGt_EORT);
+#line 889 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 889 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "insert into source values ( 2 , 20 , 'db on con2' )", ECPGt_EOIT, ECPGt_EORT);
+#line 890 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 890 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "insert into source values ( 3 , 30 , 'db on con2' )", ECPGt_EOIT, ECPGt_EORT);
+#line 891 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 891 "declare.pgc"
+
+
+    { ECPGdo(__LINE__, 0, 1, "con3", 0, ECPGst_normal, "insert into source values ( 1 , 10 , 'db on con3' )", ECPGt_EOIT, ECPGt_EORT);
+#line 893 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 893 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con3", 0, ECPGst_normal, "insert into source values ( 2 , 20 , 'db on con3' )", ECPGt_EOIT, ECPGt_EORT);
+#line 894 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 894 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con3", 0, ECPGst_normal, "insert into source values ( 3 , 30 , 'db on con3' )", ECPGt_EOIT, ECPGt_EORT);
+#line 895 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 895 "declare.pgc"
+
+
+    commitTable();
+
+    return 0;
+}
+
+/*
+ * success -- 0
+ * failed -- -1
+ */
+void dropTable()
+{
+    { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "drop table if exists source", ECPGt_EOIT, ECPGt_EORT);
+#line 908 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 908 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "drop table if exists source", ECPGt_EOIT, ECPGt_EORT);
+#line 909 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 909 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con3", 0, ECPGst_normal, "drop table if exists source", ECPGt_EOIT, ECPGt_EORT);
+#line 910 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 910 "declare.pgc"
+
+
+    { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "drop table if exists target", ECPGt_EOIT, ECPGt_EORT);
+#line 912 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 912 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "drop table if exists target", ECPGt_EOIT, ECPGt_EORT);
+#line 913 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 913 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con3", 0, ECPGst_normal, "drop table if exists target", ECPGt_EOIT, ECPGt_EORT);
+#line 914 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 914 "declare.pgc"
+
+
+    { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "drop table if exists tb1", ECPGt_EOIT, ECPGt_EORT);
+#line 916 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 916 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "drop table if exists tb1", ECPGt_EOIT, ECPGt_EORT);
+#line 917 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 917 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con3", 0, ECPGst_normal, "drop table if exists tb1", ECPGt_EOIT, ECPGt_EORT);
+#line 918 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 918 "declare.pgc"
+
+
+    commitTable();
+}
+
+void reCreateTable()
+{
+    dropTable();
+    createTable();
+}
+
+void truncateTable()
+{
+    { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "truncate table target", ECPGt_EOIT, ECPGt_EORT);
+#line 931 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 931 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "truncate table target", ECPGt_EOIT, ECPGt_EORT);
+#line 932 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 932 "declare.pgc"
+
+    { ECPGdo(__LINE__, 0, 1, "con3", 0, ECPGst_normal, "truncate table target", ECPGt_EOIT, ECPGt_EORT);
+#line 933 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 933 "declare.pgc"
+
+
+    commitTable();
+}
+
+void commitTable()
+{
+    { ECPGtrans(__LINE__, "con1", "commit");
+#line 940 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 940 "declare.pgc"
+
+    { ECPGtrans(__LINE__, "con2", "commit");
+#line 941 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 941 "declare.pgc"
+
+    { ECPGtrans(__LINE__, "con3", "commit");
+#line 942 "declare.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 942 "declare.pgc"
+
+}
+
+/*
+ * reset all the output variables
+ */
+void reset()
+{
+    int i;
+
+    truncateTable();
+
+    memset(f1,0,sizeof(f1));
+    memset(f2,0,sizeof(f2));
+    memset(f3,0,sizeof(f3));
+
+    for(i=0; i<COLUMN_NUM; i++)
+    {
+        memset(field_name[i],0, FIELD_NAME_LEN);
+    }
+}
+
+int initValues()
+{
+    return 0;
+}
+
+void releaseValues()
+{
+}
+
+void printResultF123(char *tc_name, int loop)
+{
+    int i;
+
+    if(loop>OUT_ARRAY_SZIE)
+    {
+        loop = OUT_ARRAY_SZIE;
+    }
+
+    if(tc_name)
+    {
+        printf("****%s test results:****\n",tc_name);
+    }
+
+    for (i = 0; i < loop; i++)
+        printf("f1=%d, f2=%d, f3=%s\n", f1[i], f2[i], f3[i]);
+
+    printf("\n");
+}
+
+void printResultIndF123(char *tc_name, int loop)
+{
+    int i;
+
+    if(loop>OUT_ARRAY_SZIE)
+    {
+        loop = OUT_ARRAY_SZIE;
+    }
+
+    if(tc_name)
+    {
+        printf("****%s indicator results:****\n",tc_name);
+    }
+
+    for (i = 0; i < loop; i++)
+        printf("ind_f1=%d, ind_f2=%d, ind_f3=%d\n", ind_f1[i], ind_f2[i], ind_f3[i]);
+
+    printf("\n");
+}
+
+void printFieldName(char *tc_name)
+{
+    int i;
+
+    if(tc_name)
+    {
+        printf("****%s test results:****\n",tc_name);
+    }
+
+    for (i = 0; i < COLUMN_NUM; i++)
+    {
+        printf("field[%d]'s name = %s\n", i, field_name[i]);
+    }
+
+    printf("\n");
+}
diff --git a/src/interfaces/ecpg/test/expected/sql-declare.stderr b/src/interfaces/ecpg/test/expected/sql-declare.stderr
new file mode 100644
index 0000000..beeb8ea
--- /dev/null
+++ b/src/interfaces/ecpg/test/expected/sql-declare.stderr
@@ -0,0 +1,2393 @@
+[NO_PID]: ECPGdebug: set to 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>  
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>  
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGconnect: opening database ecpg3_regression on <DEFAULT> port <DEFAULT>  
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 908: query: drop table if exists source; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 908: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 908: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 909: query: drop table if exists source; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 909: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 909: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 910: query: drop table if exists source; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 910: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 910: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 912: query: drop table if exists target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 912: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 912: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 913: query: drop table if exists target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 913: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 913: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 914: query: drop table if exists target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 914: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 914: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 916: query: drop table if exists tb1; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 916: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 916: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 917: query: drop table if exists tb1; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 917: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 917: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 918: query: drop table if exists tb1; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 918: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 918: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 871: query: create table source ( f1 integer , f2 integer , f3 varchar ( 20 ) ); with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 871: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 871: OK: CREATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 872: query: create table source ( f1 integer , f2 integer , f3 varchar ( 20 ) ); with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 872: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 872: OK: CREATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 873: query: create table source ( f1 integer , f2 integer , f3 varchar ( 20 ) ); with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 873: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 873: OK: CREATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 875: query: create table tb1 ( con1_f1 integer , con1_f2 integer , con1_f3 varchar ( 20 ) ); with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 875: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 875: OK: CREATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 876: query: create table tb1 ( con2_f1 integer , con2_f2 integer , con2_f3 varchar ( 20 ) ); with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 876: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 876: OK: CREATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 877: query: create table tb1 ( con3_f1 integer , con3_f2 integer , con3_f3 varchar ( 20 ) ); with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 877: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 877: OK: CREATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 879: query: create table target ( f1 integer , f2 integer , f3 varchar ( 20 ) ); with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 879: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 879: OK: CREATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 880: query: create table target ( f1 integer , f2 integer , f3 varchar ( 20 ) ); with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 880: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 880: OK: CREATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 881: query: create table target ( f1 integer , f2 integer , f3 varchar ( 20 ) ); with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 881: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 881: OK: CREATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 885: query: insert into source values ( 1 , 10 , 'db on con1' ); with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 885: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 885: OK: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 886: query: insert into source values ( 2 , 20 , 'db on con1' ); with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 886: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 886: OK: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 887: query: insert into source values ( 3 , 30 , 'db on con1' ); with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 887: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 887: OK: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 889: query: insert into source values ( 1 , 10 , 'db on con2' ); with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 889: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 889: OK: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 890: query: insert into source values ( 2 , 20 , 'db on con2' ); with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 890: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 890: OK: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 891: query: insert into source values ( 3 , 30 , 'db on con2' ); with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 891: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 891: OK: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 893: query: insert into source values ( 1 , 10 , 'db on con3' ); with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 893: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 893: OK: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 894: query: insert into source values ( 2 , 20 , 'db on con3' ); with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 894: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 894: OK: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 895: query: insert into source values ( 3 , 30 , 'db on con3' ); with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 895: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 895: OK: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 250: name stmt_1; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 251: query: declare cur_1 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 251: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 251: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 257: query: fetch cur_1; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 257: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 257: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 257: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 257: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 257: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 257: query: fetch cur_1; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 257: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 257: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 257: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 257: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 257: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 257: query: fetch cur_1; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 257: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 257: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 257: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 257: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 257: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 257: query: fetch cur_1; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 257: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 257: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 257: no data found on line 257
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 261: query: close cur_1; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 261: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 261: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 262: name stmt_1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 271: name stmt_2; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 272: query: declare cur_2 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 272: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 272: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 278: query: fetch cur_2; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 278: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 278: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 278: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 278: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 278: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 278: query: fetch cur_2; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 278: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 278: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 278: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 278: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 278: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 278: query: fetch cur_2; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 278: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 278: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 278: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 278: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 278: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 278: query: fetch cur_2; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 278: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 278: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 278: no data found on line 278
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 282: query: close cur_2; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 282: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 282: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 283: name stmt_2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 293: declared name stmt_3 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 294: name stmt_3; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 295: query: SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 295: using PQexecPrepared for "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 295: correctly got 3 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 295: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 295: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 295: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 295: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 295: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 295: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 295: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 295: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 295: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 297: name stmt_3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 305: declared name stmt_4 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 306: name stmt_4; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 307: query: SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 307: using PQexecPrepared for "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 307: correctly got 3 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 307: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 307: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 307: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 307: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 307: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 307: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 307: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 307: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 307: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 309: name stmt_4
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 315: declared name str_stmt_4 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 316: name str_stmt_4; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 317: query: SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 317: using PQexecPrepared for "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 317: correctly got 3 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 317: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 317: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 317: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 317: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 317: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 317: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 317: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 317: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 317: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 319: name str_stmt_4
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 327: declared name stmt_5 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 328: name stmt_5; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 330: query: declare cur_5 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 330: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 330: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 336: query: fetch cur_5; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 336: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 336: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 336: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 336: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 336: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 336: query: fetch cur_5; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 336: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 336: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 336: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 336: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 336: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 336: query: fetch cur_5; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 336: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 336: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 336: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 336: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 336: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 336: query: fetch cur_5; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 336: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 336: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 336: no data found on line 336
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 340: query: close cur_5; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 340: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 340: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 341: name stmt_5
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 349: declared name stmt_6 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 350: name stmt_6; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 352: query: declare cur_6 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 352: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 352: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 358: query: fetch cur_6; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 358: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 358: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 358: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 358: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 358: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 358: query: fetch cur_6; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 358: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 358: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 358: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 358: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 358: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 358: query: fetch cur_6; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 358: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 358: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 358: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 358: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 358: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 358: query: fetch cur_6; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 358: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 358: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 358: no data found on line 358
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 362: query: close cur_6; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 362: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 362: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 363: name stmt_6
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 370: declared name str_stmt_6 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 371: name str_stmt_6; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 373: query: declare str_cur_6 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 373: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 373: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 379: query: fetch str_cur_6; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 379: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 379: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 379: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 379: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 379: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 379: query: fetch str_cur_6; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 379: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 379: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 379: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 379: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 379: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 379: query: fetch str_cur_6; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 379: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 379: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 379: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 379: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 379: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 379: query: fetch str_cur_6; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 379: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 379: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 379: no data found on line 379
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 383: query: close str_cur_6; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 383: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 383: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 384: name str_stmt_6
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 395: declared name stmt_7 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 396: name stmt_7; query: "SELECT * FROM tb1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 405: name stmt_7
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 415: declared name stmt_8 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 416: name stmt_8; query: "SELECT * FROM tb1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 425: name stmt_8
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 434: declared name str_stmt_8 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 435: name str_stmt_8; query: "SELECT * FROM tb1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 444: name str_stmt_8
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 452: declared name stmt_9 on connection: "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 453: name stmt_9; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 454: query: SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 454: using PQexecPrepared for "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 454: correctly got 3 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 454: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 454: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 454: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 454: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 454: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 454: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 454: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 454: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 454: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 456: name stmt_9
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 464: declared name stmt_10 on connection: "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 465: name stmt_10; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 466: query: SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 466: using PQexecPrepared for "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 466: correctly got 3 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 466: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 466: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 466: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 466: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 466: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 466: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 466: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 466: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 466: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 468: name stmt_10
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 476: declared name stmt_11 on connection: "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 477: name stmt_11; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 479: query: declare cur_11 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 479: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 479: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 485: query: fetch cur_11; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 485: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 485: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 485: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 485: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 485: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 485: query: fetch cur_11; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 485: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 485: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 485: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 485: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 485: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 485: query: fetch cur_11; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 485: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 485: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 485: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 485: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 485: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 485: query: fetch cur_11; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 485: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 485: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 485: no data found on line 485
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 489: query: close cur_11; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 489: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 489: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 490: name stmt_11
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 498: declared name stmt_12 on connection: "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 499: name stmt_12; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 501: query: declare cur_12 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 501: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 501: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 507: query: fetch cur_12; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 507: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 507: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 507: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 507: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 507: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 507: query: fetch cur_12; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 507: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 507: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 507: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 507: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 507: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 507: query: fetch cur_12; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 507: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 507: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 507: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 507: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 507: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 507: query: fetch cur_12; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 507: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 507: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 507: no data found on line 507
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 511: query: close cur_12; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 511: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 511: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 512: name stmt_12
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 523: declared name stmt_13 on connection: "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 524: name stmt_13; query: "SELECT * FROM tb1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con3_f1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con3_f2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con3_f3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 533: name stmt_13
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 543: declared name stmt_14 on connection: "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 544: name stmt_14; query: "SELECT * FROM tb1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con3_f1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con3_f2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con3_f3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 553: name stmt_14
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 562: name stmt_15; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 563: query: SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 563: using PQexecPrepared for "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 563: correctly got 3 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 563: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 563: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 563: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 563: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 563: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 563: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 563: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 563: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 563: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 565: name stmt_15
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 574: name stmt_16; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 575: query: SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 575: using PQexecPrepared for "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 575: correctly got 3 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 575: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 575: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 575: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 575: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 575: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 575: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 575: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 575: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 575: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 577: name stmt_16
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 586: name stmt_17; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 588: query: declare cur_17 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 588: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 588: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 594: query: fetch cur_17; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 594: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 594: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 594: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 594: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 594: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 594: query: fetch cur_17; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 594: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 594: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 594: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 594: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 594: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 594: query: fetch cur_17; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 594: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 594: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 594: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 594: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 594: RESULT: db on con3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 594: query: fetch cur_17; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 594: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 594: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 594: no data found on line 594
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 598: query: close cur_17; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 598: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 598: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 599: name stmt_17
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 608: name stmt_18; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 610: query: declare cur_18 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 610: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 610: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 616: query: fetch cur_18; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 616: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 616: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 616: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 616: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 616: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 616: query: fetch cur_18; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 616: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 616: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 616: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 616: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 616: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 616: query: fetch cur_18; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 616: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 616: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 616: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 616: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 616: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 616: query: fetch cur_18; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 616: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 616: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 616: no data found on line 616
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 620: query: close cur_18; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 620: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 620: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 621: name stmt_18
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 633: name stmt_19; query: "SELECT * FROM tb1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con3_f1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con3_f2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con3_f3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 642: name stmt_19
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 653: name stmt_20; query: "SELECT * FROM tb1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con2_f1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con2_f2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con2_f3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 662: name stmt_20
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 670: declared name stmt_21 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 671: name stmt_21; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 672: query: SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 672: using PQexecPrepared for "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 672: correctly got 3 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 672: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 672: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 672: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 672: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 672: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 672: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 672: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 672: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 672: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 674: name stmt_21
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 682: declared name stmt_22 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 683: name stmt_22; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 685: query: declare "cur_22" cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 685: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 685: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 691: query: fetch "cur_22"; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 691: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 691: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 691: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 691: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 691: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 691: query: fetch "cur_22"; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 691: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 691: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 691: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 691: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 691: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 691: query: fetch "cur_22"; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 691: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 691: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 691: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 691: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 691: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 691: query: fetch "cur_22"; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 691: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 691: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 691: no data found on line 691
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 695: query: close "cur_22"; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 695: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 695: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 696: name stmt_22
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 707: declared name stmt_23 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 708: name stmt_23; query: "SELECT * FROM tb1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con1_f3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 717: name stmt_23
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 729: declared name strSTMT24 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 730: name strSTMT24; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 731: query: SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 731: using PQexecPrepared for "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 731: correctly got 3 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 731: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 731: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 731: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 731: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 731: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 731: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 731: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 731: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 731: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 733: name strSTMT24
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 741: declared name stmt_25 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 742: name pre_stmt_25; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 743: query: SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 743: using PQexecPrepared for "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 743: correctly got 3 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 743: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 743: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 743: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 743: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 743: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 743: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 743: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 743: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 743: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 745: name pre_stmt_25
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 753: declared name stmt_26 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 754: name pre_stmt_26; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 756: query: declare cur_26 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 756: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 756: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 762: query: fetch cur_26; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 762: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 762: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 762: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 762: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 762: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 762: query: fetch cur_26; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 762: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 762: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 762: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 762: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 762: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 762: query: fetch cur_26; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 762: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 762: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 762: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 762: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 762: RESULT: db on con2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 762: query: fetch cur_26; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 762: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 762: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 762: no data found on line 762
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 766: query: close cur_26; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 766: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 766: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 767: name pre_stmt_26
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 778: declared name stmt_27 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 779: name pre_stmt_27; query: "SELECT * FROM tb1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con2_f1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con2_f2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: NAME = con2_f3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 788: name pre_stmt_27
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 800: declared name stmt_28 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 801: name stmt_28; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 803: query: declare str_cur_28 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 803: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 803: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 809: query: fetch str_cur_28; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 809: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 809: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 809: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 809: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 809: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 809: query: fetch str_cur_28; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 809: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 809: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 809: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 809: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 809: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 809: query: fetch str_cur_28; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 809: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 809: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 809: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 809: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 809: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 809: query: fetch str_cur_28; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 809: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 809: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 809: no data found on line 809
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: raising sqlcode -245 on line 813: The cursor is invalid on line 813
+[NO_PID]: sqlca: code: -245, state: YE000
+SQL error: The cursor is invalid on line 813
+[NO_PID]: deallocate_one on line 814: name stmt_28
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGdeclare on line 824: declared name stmt_29 on connection: "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 825: name stmt_29; query: "SELECT f1,f2,f3 FROM source where f1<4"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 828: query: declare cur_29 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 828: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 828: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 834: query: fetch cur_29; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 834: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 834: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 834: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 834: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 834: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 834: query: fetch cur_29; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 834: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 834: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 834: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 834: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 834: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 834: query: fetch cur_29; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 834: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 834: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 834: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 834: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 834: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 834: query: fetch cur_29; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 834: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 834: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 834: no data found on line 834
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 838: query: close cur_29; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 838: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 838: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: query: truncate table target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 931: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 931: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: query: truncate table target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 932: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 932: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: query: truncate table target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 933: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 933: OK: TRUNCATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 843: query: declare cur_29 cursor for SELECT f1,f2,f3 FROM source where f1<4; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 843: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 843: OK: DECLARE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 847: query: fetch cur_29; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 847: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 847: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 847: RESULT: 1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 847: RESULT: 10 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 847: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 847: query: fetch cur_29; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 847: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 847: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 847: RESULT: 2 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 847: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 847: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 847: query: fetch cur_29; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 847: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 847: correctly got 1 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 847: RESULT: 3 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 847: RESULT: 30 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 847: RESULT: db on con1 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 847: query: fetch cur_29; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 847: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 847: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 847: no data found on line 847
+[NO_PID]: sqlca: code: 100, state: 02000
+[NO_PID]: ecpg_execute on line 851: query: close cur_29; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 851: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 851: OK: CLOSE CURSOR
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 852: name stmt_29
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 908: query: drop table if exists source; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 908: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 908: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 909: query: drop table if exists source; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 909: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 909: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 910: query: drop table if exists source; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 910: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 910: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 912: query: drop table if exists target; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 912: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 912: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 913: query: drop table if exists target; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 913: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 913: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 914: query: drop table if exists target; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 914: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 914: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 916: query: drop table if exists tb1; with 0 parameter(s) on connection con1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 916: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 916: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 917: query: drop table if exists tb1; with 0 parameter(s) on connection con2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 917: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 917: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 918: query: drop table if exists tb1; with 0 parameter(s) on connection con3
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 918: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 918: OK: DROP TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 940: action "commit"; connection "con1"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 941: action "commit"; connection "con2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGtrans on line 942: action "commit"; connection "con3"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_29 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_28 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_27 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_26 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_25 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name strSTMT24 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_23 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_22 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_21 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name str_stmt_8 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_8 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_7 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name str_stmt_6 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_6 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_5 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name str_stmt_4 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_4 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_3 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_finish: connection con1 closed
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_14 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_13 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_12 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_11 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_10 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_release_declared_statement: declared name stmt_9 is released
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_finish: connection con3 closed
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_finish: connection con2 closed
+[NO_PID]: sqlca: code: 0, state: 00000
diff --git a/src/interfaces/ecpg/test/expected/sql-declare.stdout b/src/interfaces/ecpg/test/expected/sql-declare.stdout
new file mode 100644
index 0000000..2ffe1d7
--- /dev/null
+++ b/src/interfaces/ecpg/test/expected/sql-declare.stdout
@@ -0,0 +1,161 @@
+****testcase1 test results:****
+f1=1, f2=10, f3=db on con3
+f1=2, f2=20, f3=db on con3
+f1=3, f2=30, f3=db on con3
+
+****testcase2 test results:****
+f1=1, f2=10, f3=db on con3
+f1=2, f2=20, f3=db on con3
+f1=3, f2=30, f3=db on con3
+
+****testcase3 test results:****
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+****testcase4 test results:****
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+****testcase5 test results:****
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+****testcase6 test results:****
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+****testcase7 test results:****
+field[0]'s name = con1_f1
+field[1]'s name = con1_f2
+field[2]'s name = con1_f3
+
+****testcase8 test results:****
+field[0]'s name = con1_f1
+field[1]'s name = con1_f2
+field[2]'s name = con1_f3
+
+field[0]'s name = con1_f1
+field[1]'s name = con1_f2
+field[2]'s name = con1_f3
+
+****testcase9 test results:****
+f1=1, f2=10, f3=db on con3
+f1=2, f2=20, f3=db on con3
+f1=3, f2=30, f3=db on con3
+
+****testcase10 test results:****
+f1=1, f2=10, f3=db on con3
+f1=2, f2=20, f3=db on con3
+f1=3, f2=30, f3=db on con3
+
+****testcase11 test results:****
+f1=1, f2=10, f3=db on con3
+f1=2, f2=20, f3=db on con3
+f1=3, f2=30, f3=db on con3
+
+****testcase12 test results:****
+f1=1, f2=10, f3=db on con3
+f1=2, f2=20, f3=db on con3
+f1=3, f2=30, f3=db on con3
+
+****testcase13 test results:****
+field[0]'s name = con3_f1
+field[1]'s name = con3_f2
+field[2]'s name = con3_f3
+
+****testcase14 test results:****
+field[0]'s name = con3_f1
+field[1]'s name = con3_f2
+field[2]'s name = con3_f3
+
+****testcase15 test results:****
+f1=1, f2=10, f3=db on con3
+f1=2, f2=20, f3=db on con3
+f1=3, f2=30, f3=db on con3
+
+****testcase16 test results:****
+f1=1, f2=10, f3=db on con2
+f1=2, f2=20, f3=db on con2
+f1=3, f2=30, f3=db on con2
+
+****testcase17 test results:****
+f1=1, f2=10, f3=db on con3
+f1=2, f2=20, f3=db on con3
+f1=3, f2=30, f3=db on con3
+
+****testcase18 test results:****
+f1=1, f2=10, f3=db on con2
+f1=2, f2=20, f3=db on con2
+f1=3, f2=30, f3=db on con2
+
+****testcase19 test results:****
+field[0]'s name = con3_f1
+field[1]'s name = con3_f2
+field[2]'s name = con3_f3
+
+****testcase20 test results:****
+field[0]'s name = con2_f1
+field[1]'s name = con2_f2
+field[2]'s name = con2_f3
+
+****testcase21 test results:****
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+****testcase22 test results:****
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+****testcase23 test results:****
+field[0]'s name = con1_f1
+field[1]'s name = con1_f2
+field[2]'s name = con1_f3
+
+****testcase24 test results:****
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+****testcase25 test results:****
+f1=1, f2=10, f3=db on con2
+f1=2, f2=20, f3=db on con2
+f1=3, f2=30, f3=db on con2
+
+****testcase26 test results:****
+f1=1, f2=10, f3=db on con2
+f1=2, f2=20, f3=db on con2
+f1=3, f2=30, f3=db on con2
+
+****testcase27 test results:****
+field[0]'s name = con2_f1
+field[1]'s name = con2_f2
+field[2]'s name = con2_f3
+
+****testcase28 test results:****
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+****testcase29 test results:****
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
+f1=1, f2=10, f3=db on con1
+f1=2, f2=20, f3=db on con1
+f1=3, f2=30, f3=db on con1
+
diff --git a/src/interfaces/ecpg/test/expected/sql-desc.c b/src/interfaces/ecpg/test/expected/sql-desc.c
index bdd12a5..bcfe1bd 100644
--- a/src/interfaces/ecpg/test/expected/sql-desc.c
+++ b/src/interfaces/ecpg/test/expected/sql-desc.c
@@ -249,7 +249,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 	/* declare c1 cursor for $1 */
 #line 58 "desc.pgc"
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c1 cursor for $1", 
+	{ ECPGopen("c1", "foo2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c1 cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "foo2", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_descriptor, "indesc", 1L, 1L, 1L, 
@@ -260,7 +260,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 59 "desc.pgc"
 
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch next from c1", ECPGt_EOIT, 
+	{ ECPGfetch("c1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch next from c1", ECPGt_EOIT, 
 	ECPGt_int,&(val1output),(long)1,(long)1,sizeof(int), 
 	ECPGt_int,&(ind1),(long)1,(long)1,sizeof(int), 
 	ECPGt_char,(val2output),(long)sizeof("AAA"),(long)1,(sizeof("AAA"))*sizeof(char), 
@@ -273,7 +273,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 	printf("val1=%d (ind1: %d) val2=%s (ind2: %d)\n",
 		val1output, ind1, val2output, ind2);
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close c1", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("c1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close c1", ECPGt_EOIT, ECPGt_EORT);
 #line 65 "desc.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
@@ -299,7 +299,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 	/* declare c2 cursor for $1 */
 #line 70 "desc.pgc"
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c2 cursor for $1", 
+	{ ECPGopen("c2", "foo3", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c2 cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "foo3", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_descriptor, "indesc", 1L, 1L, 1L, 
@@ -310,7 +310,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 71 "desc.pgc"
 
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch next from c2", ECPGt_EOIT, 
+	{ ECPGfetch("c2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch next from c2", ECPGt_EOIT, 
 	ECPGt_int,&(val1output),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,(val2output),(long)sizeof("AAA"),(long)1,(sizeof("AAA"))*sizeof(char), 
@@ -322,7 +322,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 	printf("val1=%d val2=%s\n", val1output, val2i ? "null" : val2output);
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close c2", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("c2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close c2", ECPGt_EOIT, ECPGt_EORT);
 #line 76 "desc.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
diff --git a/src/interfaces/ecpg/test/expected/sql-dyntest.c b/src/interfaces/ecpg/test/expected/sql-dyntest.c
index 2cbc196..dff22aa 100644
--- a/src/interfaces/ecpg/test/expected/sql-dyntest.c
+++ b/src/interfaces/ecpg/test/expected/sql-dyntest.c
@@ -261,7 +261,7 @@ if (sqlca.sqlcode < 0) error ( );}
 #line 58 "dyntest.pgc"
 
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare MYCURS cursor for $1", 
+  { ECPGopen("MYCURS", "myquery", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare MYCURS cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "myquery", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 60 "dyntest.pgc"
@@ -272,7 +272,7 @@ if (sqlca.sqlcode < 0) error ( );}
 
   while (1)
     {
-      { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch in MYCURS", ECPGt_EOIT, 
+      { ECPGfetch("MYCURS", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch in MYCURS", ECPGt_EOIT, 
 	ECPGt_descriptor, "MYDESC", 1L, 1L, 1L, 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
 #line 64 "dyntest.pgc"
@@ -468,7 +468,7 @@ if (sqlca.sqlcode < 0) error ( );}
 	}
     }
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close MYCURS", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGclose("MYCURS", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close MYCURS", ECPGt_EOIT, ECPGt_EORT);
 #line 194 "dyntest.pgc"
 
 if (sqlca.sqlcode < 0) error ( );}
diff --git a/src/interfaces/ecpg/test/expected/sql-execute.c b/src/interfaces/ecpg/test/expected/sql-execute.c
index aee3c1b..c511349 100644
--- a/src/interfaces/ecpg/test/expected/sql-execute.c
+++ b/src/interfaces/ecpg/test/expected/sql-execute.c
@@ -140,7 +140,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 50 "execute.pgc"
 
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare CUR cursor for $1", 
+	{ ECPGopen("CUR", "f", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare CUR cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "f", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 52 "execute.pgc"
@@ -148,7 +148,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 52 "execute.pgc"
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 8 in CUR", ECPGt_EOIT, 
+	{ ECPGfetch("CUR", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 8 in CUR", ECPGt_EOIT, 
 	ECPGt_char,(name),(long)8,(long)8,(8)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_int,(amount),(long)1,(long)8,sizeof(int), 
@@ -180,7 +180,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 		printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, n, i, a, i, l);
 	}
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close CUR", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("CUR", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close CUR", ECPGt_EOIT, ECPGt_EORT);
 #line 66 "execute.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
@@ -205,7 +205,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 72 "execute.pgc"
 
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare CUR2 cursor for $1", 
+	{ ECPGopen("CUR2", "f", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare CUR2 cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "f", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_const,"1",(long)1,(long)1,strlen("1"), 
@@ -215,7 +215,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 74 "execute.pgc"
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch in CUR2", ECPGt_EOIT, 
+	{ ECPGfetch("CUR2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch in CUR2", ECPGt_EOIT, 
 	ECPGt_char,(name),(long)8,(long)8,(8)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_int,(amount),(long)1,(long)8,sizeof(int), 
@@ -247,7 +247,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 		printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, n, i, a, i, l);
 	}
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close CUR2", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("CUR2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close CUR2", ECPGt_EOIT, ECPGt_EORT);
 #line 88 "execute.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
diff --git a/src/interfaces/ecpg/test/expected/sql-fetch.c b/src/interfaces/ecpg/test/expected/sql-fetch.c
index b547b25..e6beaf5 100644
--- a/src/interfaces/ecpg/test/expected/sql-fetch.c
+++ b/src/interfaces/ecpg/test/expected/sql-fetch.c
@@ -99,7 +99,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 26 "fetch.pgc"
 
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select * from My_Table", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGopen("C", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select * from My_Table", ECPGt_EOIT, ECPGt_EORT);
 #line 28 "fetch.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
@@ -113,7 +113,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 30 "fetch.pgc"
 
   while (1) {
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in C", ECPGt_EOIT, 
+	{ ECPGfetch("C", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in C", ECPGt_EOIT, 
 	ECPGt_int,&(i),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,(str),(long)25,(long)1,(25)*sizeof(char), 
@@ -135,7 +135,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
   /* exec sql whenever not found  continue ; */
 #line 36 "fetch.pgc"
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "move backward 2 in C", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGfetch("C", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "move backward 2 in C", ECPGt_EOIT, ECPGt_EORT);
 #line 37 "fetch.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
@@ -145,7 +145,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 37 "fetch.pgc"
 
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch $0 in C", 
+  { ECPGfetch("C", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch $0 in C", 
 	ECPGt_int,&(count),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
 	ECPGt_int,&(i),(long)1,(long)1,sizeof(int), 
@@ -162,7 +162,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
   printf("%d: %s\n", i, str);
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close C", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGclose("C", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close C", ECPGt_EOIT, ECPGt_EORT);
 #line 42 "fetch.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
@@ -176,7 +176,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 44 "fetch.pgc"
 
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare D cursor for select * from My_Table where Item1 = $1", 
+  { ECPGopen("D", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare D cursor for select * from My_Table where Item1 = $1", 
 	ECPGt_const,"1",(long)1,(long)1,strlen("1"), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 46 "fetch.pgc"
@@ -192,7 +192,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 48 "fetch.pgc"
 
   while (1) {
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in D", ECPGt_EOIT, 
+	{ ECPGfetch("D", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in D", ECPGt_EOIT, 
 	ECPGt_int,&(i),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,(str),(long)25,(long)1,(25)*sizeof(char), 
@@ -210,7 +210,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 	printf("%d: %s\n", i, str);
   }
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close D", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGclose("D", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close D", ECPGt_EOIT, ECPGt_EORT);
 #line 53 "fetch.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
diff --git a/src/interfaces/ecpg/test/expected/sql-oldexec.c b/src/interfaces/ecpg/test/expected/sql-oldexec.c
index 5b74dda..2e398c2 100644
--- a/src/interfaces/ecpg/test/expected/sql-oldexec.c
+++ b/src/interfaces/ecpg/test/expected/sql-oldexec.c
@@ -141,7 +141,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 51 "oldexec.pgc"
 
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 1, ECPGst_normal, "declare CUR cursor for $1", 
+	{ ECPGopen("CUR", "f", __LINE__, 0, 1, NULL, 1, ECPGst_normal, "declare CUR cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "f", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 53 "oldexec.pgc"
@@ -149,7 +149,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 53 "oldexec.pgc"
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 1, ECPGst_normal, "fetch 8 in CUR", ECPGt_EOIT, 
+	{ ECPGfetch("CUR", __LINE__, 0, 1, NULL, 1, ECPGst_normal, "fetch 8 in CUR", ECPGt_EOIT, 
 	ECPGt_char,(name),(long)8,(long)8,(8)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_int,(amount),(long)1,(long)8,sizeof(int), 
@@ -171,7 +171,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 		printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, n, i, a, i, l);
 	}
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 1, ECPGst_normal, "close CUR", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("CUR", __LINE__, 0, 1, NULL, 1, ECPGst_normal, "close CUR", ECPGt_EOIT, ECPGt_EORT);
 #line 65 "oldexec.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
@@ -190,7 +190,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 70 "oldexec.pgc"
 
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 1, ECPGst_normal, "declare CUR3 cursor for $1", 
+	{ ECPGopen("CUR3", "f", __LINE__, 0, 1, NULL, 1, ECPGst_normal, "declare CUR3 cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "f", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_const,"1",(long)1,(long)1,strlen("1"), 
@@ -200,7 +200,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 72 "oldexec.pgc"
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 1, ECPGst_normal, "fetch in CUR3", ECPGt_EOIT, 
+	{ ECPGfetch("CUR3", __LINE__, 0, 1, NULL, 1, ECPGst_normal, "fetch in CUR3", ECPGt_EOIT, 
 	ECPGt_char,(name),(long)8,(long)8,(8)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_int,(amount),(long)1,(long)8,sizeof(int), 
@@ -222,7 +222,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 		printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, n, i, a, i, l);
 	}
 
-	{ ECPGdo(__LINE__, 0, 1, NULL, 1, ECPGst_normal, "close CUR3", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("CUR3", __LINE__, 0, 1, NULL, 1, ECPGst_normal, "close CUR3", ECPGt_EOIT, ECPGt_EORT);
 #line 84 "oldexec.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
diff --git a/src/interfaces/ecpg/test/expected/sql-quote.c b/src/interfaces/ecpg/test/expected/sql-quote.c
index 0a3b77c..ec03612 100644
--- a/src/interfaces/ecpg/test/expected/sql-quote.c
+++ b/src/interfaces/ecpg/test/expected/sql-quote.c
@@ -162,7 +162,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 43 "quote.pgc"
 
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select * from \"My_Table\"", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGopen("C", NULL, __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select * from \"My_Table\"", ECPGt_EOIT, ECPGt_EORT);
 #line 45 "quote.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
@@ -178,7 +178,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
   while (true)
   {
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch C", ECPGt_EOIT, 
+	{ ECPGfetch("C", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch C", ECPGt_EOIT, 
 	ECPGt_int,&(i),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,(var),(long)25,(long)1,(25)*sizeof(char), 
diff --git a/src/interfaces/ecpg/test/expected/sql-sqlda.c b/src/interfaces/ecpg/test/expected/sql-sqlda.c
index b470b04..6bfcbe2 100644
--- a/src/interfaces/ecpg/test/expected/sql-sqlda.c
+++ b/src/interfaces/ecpg/test/expected/sql-sqlda.c
@@ -251,7 +251,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "open");
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1", 
+	{ ECPGopen("mycur1", "st_id1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 103 "sqlda.pgc"
@@ -268,7 +268,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	while (1)
 	{
 		strcpy(msg, "fetch");
-		{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT, 
+		{ ECPGfetch("mycur1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT, 
 	ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
 #line 111 "sqlda.pgc"
@@ -289,7 +289,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "close");
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("mycur1", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT);
 #line 120 "sqlda.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
@@ -324,7 +324,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "open");
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1", 
+	{ ECPGopen("mycur2", "st_id2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1", 
 	ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 138 "sqlda.pgc"
@@ -334,7 +334,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 
 	strcpy(msg, "fetch");
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch all from mycur2", ECPGt_EOIT, 
+	{ ECPGfetch("mycur2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch all from mycur2", ECPGt_EOIT, 
 	ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
 #line 141 "sqlda.pgc"
@@ -357,7 +357,7 @@ if (sqlca.sqlcode < 0) exit (1);}
 	}
 
 	strcpy(msg, "close");
-	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGclose("mycur2", __LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT);
 #line 157 "sqlda.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
diff --git a/src/interfaces/ecpg/test/regression.h b/src/interfaces/ecpg/test/regression.h
index 4aa13b6..aa6421d 100644
--- a/src/interfaces/ecpg/test/regression.h
+++ b/src/interfaces/ecpg/test/regression.h
@@ -1,5 +1,5 @@
 exec sql define REGRESSDB1 ecpg1_regression;
 exec sql define REGRESSDB2 ecpg2_regression;
-
+exec sql define REGRESSDB3 ecpg3_regression;
 exec sql define REGRESSUSER1 regress_ecpg_user1;
 exec sql define REGRESSUSER2 regress_ecpg_user2;
diff --git a/src/interfaces/ecpg/test/sql/.gitignore b/src/interfaces/ecpg/test/sql/.gitignore
index cd6f342..83bc47e 100644
--- a/src/interfaces/ecpg/test/sql/.gitignore
+++ b/src/interfaces/ecpg/test/sql/.gitignore
@@ -6,6 +6,8 @@
 /code100.c
 /copystdout
 /copystdout.c
+/declare
+/declare.c
 /define
 /define.c
 /desc
diff --git a/src/interfaces/ecpg/test/sql/Makefile b/src/interfaces/ecpg/test/sql/Makefile
index 6bc67e9..d313464 100644
--- a/src/interfaces/ecpg/test/sql/Makefile
+++ b/src/interfaces/ecpg/test/sql/Makefile
@@ -22,7 +22,8 @@ TESTS = array array.c \
         parser parser.c \
         quote quote.c \
         show show.c \
-        insupd insupd.c
+        insupd insupd.c \
+        declare declare.c
 
 all: $(TESTS)
 
diff --git a/src/interfaces/ecpg/test/sql/declare.pgc b/src/interfaces/ecpg/test/sql/declare.pgc
new file mode 100644
index 0000000..d3bfb55
--- /dev/null
+++ b/src/interfaces/ecpg/test/sql/declare.pgc
@@ -0,0 +1,1028 @@
+#include <locale.h>
+#include <string.h>
+#include <stdlib.h>
+
+exec sql whenever sqlerror sqlprint;
+
+exec sql include sqlca;
+exec sql include ../regression;
+
+#define OUT_ARRAY_SZIE 20
+#define TEST_CASE_NUM 29
+#define COLUMN_NUM 3
+#define FIELD_NAME_LEN 30
+
+void declare_test(char * tc_name);
+int createTable(void);
+void dropTable(void);
+void reCreateTable(void);
+void truncateTable(void);
+void commitTable(void);
+void reset(void);
+int initValues(void);
+void releaseValues(void);
+void printResultF123(char *tc_name, int loop);
+void printResultIndF123(char *tc_name, int loop);
+int startManualTest(char *in);
+int startAutoTest(void);
+void printFieldName(char *);
+
+EXEC SQL BEGIN DECLARE SECTION;
+
+    //input variables
+    int         in_f1 = 1 ;
+    double      in_f2 = 10;
+    char        in_f3[20] = {"one"};
+
+    //output variables
+    int f1[OUT_ARRAY_SZIE];
+    int f2[OUT_ARRAY_SZIE];
+    char f3[OUT_ARRAY_SZIE][20];
+
+    char field_name[COLUMN_NUM][FIELD_NAME_LEN];
+
+
+    int ind_f1[OUT_ARRAY_SZIE],ind_f2[OUT_ARRAY_SZIE],ind_f3[OUT_ARRAY_SZIE];
+
+EXEC SQL END DECLARE SECTION;
+
+int
+main (int argc, char *argv[])
+{
+    setlocale(LC_ALL, "C");
+
+    ECPGdebug(1, stderr);
+
+    /* connect to database */
+    EXEC SQL CONNECT TO REGRESSDB1 AS con1;
+    EXEC SQL CONNECT TO REGRESSDB2 AS con2;
+    EXEC SQL CONNECT TO REGRESSDB3 as con3;
+
+    if(initValues())
+    {
+        printf("Error: initValues return error!\n");
+
+        releaseValues();
+        return -1;
+    }
+
+    if(argc == 2) //start manual test
+    {
+        printf("Start manual test! \n");
+        startManualTest(argv[1]);
+    }
+    else  //start auto test
+    {
+        startAutoTest();
+    }
+
+    EXEC SQL DISCONNECT con1;
+
+    EXEC SQL DISCONNECT ALL;
+
+    releaseValues();
+
+    return (0);
+}
+
+int startManualTest(char *in)
+{
+    if(!strcmp(in,"cr"))
+    {
+        createTable();
+    }
+    else if(!strcmp(in,"dr"))
+    {
+        dropTable();
+    }
+    else if(!strcmp(in,"re"))
+    {
+        reCreateTable();
+    }
+    else if(!strcmp(in,"help"))
+    {
+        printf("====Supporting the following parameters====\n");
+        printf("1. cr -- create tables\n");
+        printf("2. dr -- drop tables\n");
+        printf("3. re -- drop tables and create tables\n");
+        printf("4. testcaseX where X is a digit form 1 to %d\n",TEST_CASE_NUM);
+        printf("If you don't give any parameter, the program will start the test from the testcase1 to testcase%d automatically\n",TEST_CASE_NUM);
+    }
+    else
+    {
+        declare_test(in);
+    }
+
+    commitTable();
+
+    return 0;
+}
+
+int startAutoTest()
+{
+    int i;
+    char tc_name[20];
+
+    dropTable();
+
+    if(createTable())
+    {
+        printf("Error: createTable return error!\n");
+        return -1;
+    }
+
+    for(i=1;i<=TEST_CASE_NUM;i++)
+    {
+        sprintf(tc_name,"testcase%d",i);
+        declare_test(tc_name);
+    }
+
+    dropTable();
+
+    return 0;
+}
+
+
+/*
+ * default connection: con3
+ * Non-default connection: con1, con2
+ *
+ * testcase1. using DECLARE STATEMENT, let CURSOR statement precede PREPARE statement
+ *        ---test result: ok
+ * testcase2. without using DECLARE STATEMENT, let CURSOR statement precede PREPARE statement
+ *        ---test result: ok
+ *
+ * testcase3. using DECLARE STATEMENT at con1, using PREPARE and EXECUTE statement without using AT clause
+ *        ---test result: ok
+ * testcase4. using DECLARE STATEMENT at con1, using PREPARE and EXECUTE statement at con2
+ *        ---test result: ok
+ * testcase5. using DECLARE STATEMENT at con1, using PREPARE and CURSOR statement without using AT clause
+ *        ---test result: ok
+ * testcase6. using DECLARE STATEMENT at con1, using PREPARE and CURSOR statement at con2
+ *        ---test result: ok
+ * testcase7. using DECLARE STATEMENT at con1, using DESCRIBE statement without using AT clause
+ *        ---test result: ok
+ * testcase8. using DECLARE STATEMENT at con1, using DESCRIBE statement at con2
+ *        ---test result: ok
+ *
+ * testcase9. using DECLARE STATEMENT at con3, using PREPARE and EXECUTE statement without using AT clause
+ *        ---test result: ok
+ * testcase10. using DECLARE STATEMENT at con3, using PREPARE and EXECUTE statement at con2
+ *        ---test result: ok
+ * testcase11. using DECLARE STATEMENT at con3, using PREPARE and CURSOR statement without using AT clause
+ *        ---test result: ok
+ * testcase12. using DECLARE STATEMENT at con3, using PREPARE and CURSOR statement at con2
+ *        ---test result: ok
+ * testcase13. using DECLARE STATEMENT at con3, using DESCRIBE statement without using AT clause
+ *        ---test result: ok
+ * testcase14. using DECLARE STATEMENT at con3, using DESCRIBE statement at con2
+ *        ---test result: ok
+ *
+ * testcase15. using DECLARE STATEMENT without using AT clause, using PREPARE and EXECUTE statement without using AT clause
+ *        ---test result: ok
+ * testcase16. using DECLARE STATEMENT without using AT clause, using PREPARE and EXECUTE statement at con2
+ *        ---test result: ok
+ * testcase17. using DECLARE STATEMENT without using AT clause, using PREPARE and CURSOR statement without using AT clause
+ *        ---test result: ok
+ * testcase18. using DECLARE STATEMENT without using AT clause, using PREPARE and CURSOR statement at con2
+ *        ---test result: ok
+ * testcase19. using DECLARE STATEMENT without using AT clause, using DESCRIBE statement without using AT clause
+ *        ---test result: ok
+ * testcase20. using DECLARE STATEMENT without using AT clause, using DESCRIBE statement at con2
+ *        ---test result: ok
+
+ * testcase21. using DECLARE STATEMENT at con1, using PREPARE and EXECUTE statement at con2
+ *            using quoted string as declared name
+ *        ---test result: ok
+ * testcase22. using DECLARE STATEMENT at con1, using PREPARE and CURSOR statement at con2
+ *            using quoted string as declared name
+ *        ---test result: ok
+ * testcase23. using DECLARE STATEMENT at con1, using DESCRIBE statement at con2
+ *            using quoted string as declared name
+ *        ---test result: ok
+ *
+ * testcase24. using DECLARE STATEMENT at con1, using PREPARE and EXECUTE statement at con2
+ *            using host variable as declared name
+ *        ---test result:
+ *
+ * testcase25. using DECLARE STATEMENT at con1, using PREPARE and EXECUTE statement at con2 and without referring the DECLARE statement
+ *        ---test result: ok
+ * testcase26. using DECLARE STATEMENT at con1, using PREPARE and CURSOR statement at con2 and without referring the DECLARE statement
+ *        ---test result: ok
+ * testcase27. using DECLARE STATEMENT at con1, using PREPARE and DESCRIBE statement at con2 and without referring the DECLARE statement
+ *        ---test result: ok
+ *
+ * testcase28. Using host variable as cursor name in the DECLARE/OPEN CURSOR statement,
+ *             using the content in the host variable as the cursor name in the CLOSE CURSOR statement
+ *             This is nothing with DECLARE STATEMENT feature, this case just verify a bug that cursor name can be closed by using
+ *             content of host variable while the cursor name is declared/opened by using the host variable.
+ *        ---test result: ok
+ *
+ * testcase29. using DECLARE STATEMENT at con1, using PREPARE and CURSOR statement without using AT clause
+ *             one cursor is set to "open" and "close" twice.
+ *             Check the declared name can be referred by the cursor at the second time correctly
+ *        ---test result: ok
+ */
+void declare_test(char * tc_name)
+{
+    EXEC SQL BEGIN DECLARE SECTION;
+    int i;
+
+    char    *selectString = "SELECT f1,f2,f3 FROM source where f1<4";
+    char    *selectTb1 = "SELECT * FROM tb1";
+
+    char    *stmt_4 = "str_stmt_4";
+    char    *stmt_6 = "str_stmt_6";
+    char    *stmt_8 = "str_stmt_8";
+
+    char    *cur_6 = "str_cur_6";
+
+    char    *desc_8 = "str_desc_8";
+
+    EXEC SQL END DECLARE SECTION;
+
+    if(!strcmp(tc_name,"testcase1"))
+    {
+        reset();
+
+        EXEC SQL DECLARE stmt_1 STATEMENT;
+        EXEC SQL DECLARE cur_1 CURSOR FOR stmt_1;
+        EXEC SQL PREPARE stmt_1 FROM :selectString;
+        EXEC SQL OPEN cur_1;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL FETCH cur_1 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL CLOSE cur_1;
+        EXEC SQL DEALLOCATE PREPARE stmt_1;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase2"))
+    {
+        reset();
+
+        EXEC SQL DECLARE cur_2 CURSOR FOR stmt_2;
+        EXEC SQL PREPARE stmt_2 FROM :selectString;
+        EXEC SQL OPEN cur_2;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL FETCH cur_2 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL CLOSE cur_2;
+        EXEC SQL DEALLOCATE PREPARE stmt_2;
+
+        EXEC SQL WHENEVER NOT FOUND CONTINUE;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase3"))
+    {
+        reset();
+
+        EXEC SQL AT con1 DECLARE stmt_3 STATEMENT;
+        EXEC SQL PREPARE stmt_3 FROM :selectString;
+        EXEC SQL EXECUTE stmt_3 INTO :f1,:f2,:f3;
+
+        EXEC SQL DEALLOCATE PREPARE stmt_3;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase4"))
+    {
+        reset();
+
+        EXEC SQL AT con1 DECLARE stmt_4 STATEMENT;
+        EXEC SQL AT con2 PREPARE stmt_4 FROM :selectString;
+        EXEC SQL AT con2 EXECUTE stmt_4 INTO :f1,:f2,:f3;
+
+        EXEC SQL DEALLOCATE PREPARE stmt_4;
+
+        printResultF123(tc_name,3);
+
+        reset();
+
+        EXEC SQL AT con1 DECLARE :stmt_4 STATEMENT;
+        EXEC SQL AT con2 PREPARE :stmt_4 FROM :selectString;
+        EXEC SQL AT con2 EXECUTE :stmt_4 INTO :f1,:f2,:f3;
+
+        EXEC SQL DEALLOCATE PREPARE :stmt_4;
+
+        printResultF123(NULL,3);
+    }
+    else if(!strcmp(tc_name,"testcase5"))
+    {
+        reset();
+
+        EXEC SQL AT con1 DECLARE stmt_5 STATEMENT;
+        EXEC SQL PREPARE stmt_5 FROM :selectString;
+        EXEC SQL DECLARE cur_5 CURSOR FOR stmt_5;
+        EXEC SQL OPEN cur_5;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL FETCH cur_5 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL CLOSE cur_5;
+        EXEC SQL DEALLOCATE PREPARE stmt_5;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase6"))
+    {
+        reset();
+
+        EXEC SQL AT con1 DECLARE stmt_6 STATEMENT;
+        EXEC SQL AT con2 PREPARE stmt_6 FROM :selectString;
+        EXEC SQL AT con2 DECLARE cur_6 CURSOR FOR stmt_6;
+        EXEC SQL AT con2 OPEN cur_6;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL AT con2 FETCH cur_6 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL AT con2 CLOSE cur_6;
+        EXEC SQL AT con2 DEALLOCATE PREPARE stmt_6;
+        EXEC SQL WHENEVER NOT FOUND CONTINUE;
+
+        printResultF123(tc_name,3);
+
+        reset();
+
+        EXEC SQL AT con1 DECLARE :stmt_6 STATEMENT;
+        EXEC SQL AT con2 PREPARE :stmt_6 FROM :selectString;
+        EXEC SQL AT con2 DECLARE :cur_6 CURSOR FOR :stmt_6;
+        EXEC SQL AT con2 OPEN :cur_6;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL AT con2 FETCH :cur_6 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL AT con2 CLOSE :cur_6;
+        EXEC SQL AT con2 DEALLOCATE PREPARE :stmt_6;
+        EXEC SQL WHENEVER NOT FOUND CONTINUE;
+
+        printResultF123(NULL,3);
+    }
+    else if(!strcmp(tc_name,"testcase7"))
+    {
+        reset();
+
+        EXEC SQL ALLOCATE DESCRIPTOR desc_7;
+
+        EXEC SQL AT con1 DECLARE stmt_7 STATEMENT;
+        EXEC SQL PREPARE stmt_7 FROM :selectTb1;
+        EXEC SQL DESCRIBE stmt_7 into SQL DESCRIPTOR desc_7;
+
+        for(i=1; i<4; i++)
+        {
+            EXEC SQL GET DESCRIPTOR desc_7 value :i :field_name[i-1] = name;
+        }
+
+        EXEC SQL DEALLOCATE DESCRIPTOR desc_7;
+        EXEC SQL DEALLOCATE PREPARE stmt_7;
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase8"))
+    {
+        reset();
+
+        EXEC SQL ALLOCATE DESCRIPTOR desc_8;
+
+        EXEC SQL AT con1 DECLARE stmt_8 STATEMENT;
+        EXEC SQL AT con2 PREPARE stmt_8 FROM :selectTb1;
+        EXEC SQL AT con2 DESCRIBE stmt_8 into SQL DESCRIPTOR desc_8;
+
+        for(i=1; i<4; i++)
+        {
+            EXEC SQL GET DESCRIPTOR desc_8 value :i :field_name[i-1] = name;
+        }
+
+        EXEC SQL DEALLOCATE DESCRIPTOR desc_8;
+        EXEC SQL AT con2 DEALLOCATE PREPARE stmt_8;
+
+        printFieldName(tc_name);
+
+
+        reset();
+
+        EXEC SQL ALLOCATE DESCRIPTOR :desc_8;
+
+        EXEC SQL AT con1 DECLARE :stmt_8 STATEMENT;
+        EXEC SQL AT con2 PREPARE :stmt_8 FROM :selectTb1;
+        EXEC SQL AT con2 DESCRIBE :stmt_8 into SQL DESCRIPTOR :desc_8;
+
+        for(i=1; i<4; i++)
+        {
+            EXEC SQL GET DESCRIPTOR :desc_8 value :i :field_name[i-1] = name;
+        }
+
+        EXEC SQL DEALLOCATE DESCRIPTOR :desc_8;
+        EXEC SQL AT con2 DEALLOCATE PREPARE :stmt_8;
+
+        printFieldName(NULL);
+    }
+    else if(!strcmp(tc_name,"testcase9"))
+    {
+        reset();
+
+        EXEC SQL AT con3 DECLARE stmt_9 STATEMENT;
+        EXEC SQL PREPARE stmt_9 FROM :selectString;
+        EXEC SQL EXECUTE stmt_9 INTO :f1,:f2,:f3;
+
+        EXEC SQL DEALLOCATE PREPARE stmt_9;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase10"))
+    {
+        reset();
+
+        EXEC SQL AT con3 DECLARE stmt_10 STATEMENT;
+        EXEC SQL AT con2 PREPARE stmt_10 FROM :selectString;
+        EXEC SQL AT con2 EXECUTE stmt_10 INTO :f1,:f2,:f3;
+
+        EXEC SQL AT con2 DEALLOCATE PREPARE stmt_10;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase11"))
+    {
+        reset();
+
+        EXEC SQL AT con3 DECLARE stmt_11 STATEMENT;
+        EXEC SQL PREPARE stmt_11 FROM :selectString;
+        EXEC SQL DECLARE cur_11 CURSOR FOR stmt_11;
+        EXEC SQL OPEN cur_11;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL FETCH cur_11 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL CLOSE cur_11;
+        EXEC SQL DEALLOCATE PREPARE stmt_11;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase12"))
+    {
+        reset();
+
+        EXEC SQL AT con3 DECLARE stmt_12 STATEMENT;
+        EXEC SQL AT con2 PREPARE stmt_12 FROM :selectString;
+        EXEC SQL AT con2 DECLARE cur_12 CURSOR FOR stmt_12;
+        EXEC SQL AT con2 OPEN cur_12;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL AT con2 FETCH cur_12 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL AT con2 CLOSE cur_12;
+        EXEC SQL AT con2 DEALLOCATE PREPARE stmt_12;
+        EXEC SQL WHENEVER NOT FOUND CONTINUE;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase13"))
+    {
+        reset();
+
+        EXEC SQL ALLOCATE DESCRIPTOR desc_13;
+
+        EXEC SQL AT con3 DECLARE stmt_13 STATEMENT;
+        EXEC SQL PREPARE stmt_13 FROM :selectTb1;
+        EXEC SQL DESCRIBE stmt_13 into SQL DESCRIPTOR desc_13;
+
+        for(i=1; i<4; i++)
+        {
+            EXEC SQL GET DESCRIPTOR desc_13 value :i :field_name[i-1] = name;
+        }
+
+        EXEC SQL DEALLOCATE DESCRIPTOR desc_13;
+        EXEC SQL DEALLOCATE PREPARE stmt_13;
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase14"))
+    {
+        reset();
+
+        EXEC SQL ALLOCATE DESCRIPTOR desc_14;
+
+        EXEC SQL AT con3 DECLARE stmt_14 STATEMENT;
+        EXEC SQL AT con2 PREPARE stmt_14 FROM :selectTb1;
+        EXEC SQL AT con2 DESCRIBE stmt_14 into SQL DESCRIPTOR desc_14;
+
+        for(i=1; i<4; i++)
+        {
+            EXEC SQL GET DESCRIPTOR desc_14 value :i :field_name[i-1] = name;
+        }
+
+        EXEC SQL DEALLOCATE DESCRIPTOR desc_14;
+        EXEC SQL AT con2 DEALLOCATE PREPARE stmt_14;
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase15"))
+    {
+        reset();
+
+        EXEC SQL DECLARE stmt_15 STATEMENT;
+        EXEC SQL PREPARE stmt_15 FROM :selectString;
+        EXEC SQL EXECUTE stmt_15 INTO :f1,:f2,:f3;
+
+        EXEC SQL DEALLOCATE PREPARE stmt_15;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase16"))
+    {
+        reset();
+
+        EXEC SQL DECLARE stmt_16 STATEMENT;
+        EXEC SQL AT con2 PREPARE stmt_16 FROM :selectString;
+        EXEC SQL AT con2 EXECUTE stmt_16 INTO :f1,:f2,:f3;
+
+        EXEC SQL AT con2 DEALLOCATE PREPARE stmt_16;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase17"))
+    {
+        reset();
+
+        EXEC SQL DECLARE stmt_17 STATEMENT;
+        EXEC SQL PREPARE stmt_17 FROM :selectString;
+        EXEC SQL DECLARE cur_17 CURSOR FOR stmt_17;
+        EXEC SQL OPEN cur_17;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL FETCH cur_17 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL CLOSE cur_17;
+        EXEC SQL DEALLOCATE PREPARE stmt_17;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase18"))
+    {
+        reset();
+
+        EXEC SQL DECLARE stmt_18 STATEMENT;
+        EXEC SQL AT con2 PREPARE stmt_18 FROM :selectString;
+        EXEC SQL AT con2 DECLARE cur_18 CURSOR FOR stmt_18;
+        EXEC SQL AT con2 OPEN cur_18;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL AT con2 FETCH cur_18 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL AT con2 CLOSE cur_18;
+        EXEC SQL AT con2 DEALLOCATE PREPARE stmt_18;
+        EXEC SQL WHENEVER NOT FOUND CONTINUE;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase19"))
+    {
+        reset();
+
+        EXEC SQL ALLOCATE DESCRIPTOR desc_19;
+
+        EXEC SQL DECLARE stmt_19 STATEMENT;
+        EXEC SQL PREPARE stmt_19 FROM :selectTb1;
+        EXEC SQL DESCRIBE stmt_19 into SQL DESCRIPTOR desc_19;
+
+        for(i=1; i<4; i++)
+        {
+            EXEC SQL GET DESCRIPTOR desc_19 value :i :field_name[i-1] = name;
+        }
+
+        EXEC SQL DEALLOCATE DESCRIPTOR desc_19;
+        EXEC SQL DEALLOCATE PREPARE stmt_19;
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase20"))
+    {
+        reset();
+
+        EXEC SQL ALLOCATE DESCRIPTOR desc_20;
+
+        EXEC SQL DECLARE stmt_20 STATEMENT;
+        EXEC SQL AT con2 PREPARE stmt_20 FROM :selectTb1;
+        EXEC SQL AT con2 DESCRIBE stmt_20 into SQL DESCRIPTOR desc_20;
+
+        for(i=1; i<4; i++)
+        {
+            EXEC SQL GET DESCRIPTOR desc_20 value :i :field_name[i-1] = name;
+        }
+
+        EXEC SQL DEALLOCATE DESCRIPTOR desc_20;
+        EXEC SQL AT con2 DEALLOCATE PREPARE stmt_20;
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase21"))
+    {
+        reset();
+
+        EXEC SQL AT con1 DECLARE "stmt_21" STATEMENT;
+        EXEC SQL AT con2 PREPARE "stmt_21" FROM :selectString;
+        EXEC SQL AT con2 EXECUTE "stmt_21" INTO :f1,:f2,:f3;
+
+        EXEC SQL DEALLOCATE PREPARE "stmt_21";
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase22"))
+    {
+        reset();
+
+        EXEC SQL AT con1 DECLARE "stmt_22" STATEMENT;
+        EXEC SQL AT con2 PREPARE "stmt_22" FROM :selectString;
+        EXEC SQL AT con2 DECLARE "cur_22" CURSOR FOR "stmt_22";
+        EXEC SQL AT con2 OPEN "cur_22";
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL AT con2 FETCH "cur_22" INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL AT con2 CLOSE "cur_22";
+        EXEC SQL AT con2 DEALLOCATE PREPARE "stmt_22";
+        EXEC SQL WHENEVER NOT FOUND CONTINUE;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase23"))
+    {
+        reset();
+
+        EXEC SQL ALLOCATE DESCRIPTOR desc_23;
+
+        EXEC SQL AT con1 DECLARE "stmt_23" STATEMENT;
+        EXEC SQL AT con2 PREPARE "stmt_23" FROM :selectTb1;
+        EXEC SQL AT con2 DESCRIBE "stmt_23" into SQL DESCRIPTOR desc_23;
+
+        for(i=1; i<4; i++)
+        {
+            EXEC SQL GET DESCRIPTOR desc_23 value :i :field_name[i-1] = name;
+        }
+
+        EXEC SQL DEALLOCATE DESCRIPTOR desc_23;
+        EXEC SQL AT con2 DEALLOCATE PREPARE "stmt_23";
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase24"))
+    {
+        EXEC SQL BEGIN DECLARE SECTION;
+        char *char_stmt_24 = "strSTMT24";
+        EXEC SQL END DECLARE SECTION;
+
+        reset();
+
+        EXEC SQL AT con1 DECLARE :char_stmt_24 STATEMENT;
+        EXEC SQL AT con2 PREPARE :char_stmt_24 FROM :selectString;
+        EXEC SQL AT con2 EXECUTE :char_stmt_24 INTO :f1,:f2,:f3;
+
+        EXEC SQL DEALLOCATE PREPARE :char_stmt_24;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase25"))
+    {
+        reset();
+
+        EXEC SQL AT con1 DECLARE stmt_25 STATEMENT;
+        EXEC SQL AT con2 PREPARE pre_stmt_25 FROM :selectString;
+        EXEC SQL AT con2 EXECUTE pre_stmt_25 INTO :f1,:f2,:f3;
+
+        EXEC SQL AT con2 DEALLOCATE PREPARE pre_stmt_25;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase26"))
+    {
+        reset();
+
+        EXEC SQL AT con1 DECLARE stmt_26 STATEMENT;
+        EXEC SQL AT con2 PREPARE pre_stmt_26 FROM :selectString;
+        EXEC SQL AT con2 DECLARE cur_26 CURSOR FOR pre_stmt_26;
+        EXEC SQL AT con2 OPEN cur_26;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL AT con2 FETCH cur_26 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL AT con2 CLOSE cur_26;
+        EXEC SQL AT con2 DEALLOCATE PREPARE pre_stmt_26;
+        EXEC SQL WHENEVER NOT FOUND CONTINUE;
+
+        printResultF123(tc_name,3);
+    }
+    else if(!strcmp(tc_name,"testcase27"))
+    {
+        reset();
+
+        EXEC SQL ALLOCATE DESCRIPTOR desc_27;
+
+        EXEC SQL AT con1 DECLARE stmt_27 STATEMENT;
+        EXEC SQL AT con2 PREPARE pre_stmt_27 FROM :selectTb1;
+        EXEC SQL AT con2 DESCRIBE pre_stmt_27 into SQL DESCRIPTOR desc_27;
+
+        for(i=1; i<4; i++)
+        {
+            EXEC SQL GET DESCRIPTOR desc_27 value :i :field_name[i-1] = name;
+        }
+
+        EXEC SQL DEALLOCATE DESCRIPTOR desc_27;
+        EXEC SQL AT con2 DEALLOCATE PREPARE pre_stmt_27;
+
+        printFieldName(tc_name);
+    }
+    else if(!strcmp(tc_name,"testcase28"))
+    {
+        EXEC SQL BEGIN DECLARE SECTION;
+        char    *cur_28 = "str_cur_28";
+        EXEC SQL END DECLARE SECTION;
+
+        reset();
+
+        EXEC SQL AT con1 DECLARE stmt_28 STATEMENT;
+        EXEC SQL AT con2 PREPARE stmt_28 FROM :selectString;
+        EXEC SQL AT con2 DECLARE :cur_28 CURSOR FOR stmt_28;
+        EXEC SQL AT con2 OPEN :cur_28;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL AT con2 FETCH :cur_28 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL AT con2 CLOSE str_cur_28;
+        EXEC SQL AT con2 DEALLOCATE PREPARE stmt_28;
+        EXEC SQL WHENEVER NOT FOUND CONTINUE;
+
+        printResultF123(tc_name,3);
+
+    }
+    else if(!strcmp(tc_name,"testcase29"))
+    {
+        reset();
+
+        EXEC SQL AT con1 DECLARE stmt_29 STATEMENT;
+        EXEC SQL PREPARE stmt_29 FROM :selectString;
+        EXEC SQL DECLARE cur_29 CURSOR FOR stmt_29;
+
+        EXEC SQL OPEN cur_29;
+
+        EXEC SQL WHENEVER NOT FOUND DO BREAK;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL FETCH cur_29 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL CLOSE cur_29;
+        printResultF123(tc_name,3);
+
+        reset();
+        /* Open and fetch cursor again */
+        EXEC SQL OPEN cur_29;
+        i = 0;
+        while(1)
+        {
+            EXEC SQL FETCH cur_29 INTO :f1[i],:f2[i],:f3[i];
+            i++;
+        }
+
+        EXEC SQL CLOSE cur_29;
+        EXEC SQL DEALLOCATE PREPARE stmt_29;
+        EXEC SQL WHENEVER NOT FOUND CONTINUE;
+
+        printResultF123(NULL,3);
+    }
+    else
+    {
+        EXEC SQL WHENEVER NOT FOUND CONTINUE;
+        printf("Sorry, there isn't this testcase: %s!\n",tc_name);
+    }
+}
+
+
+/*
+ * success -- 0
+ * failed -- -1
+ */
+int createTable()
+{
+    EXEC SQL AT con1 CREATE TABLE source (f1 integer, f2 integer, f3 varchar(20));
+    EXEC SQL AT con2 CREATE TABLE source (f1 integer, f2 integer, f3 varchar(20));
+    EXEC SQL AT con3 CREATE TABLE source (f1 integer, f2 integer, f3 varchar(20));
+
+    EXEC SQL AT con1 CREATE TABLE tb1 (con1_f1 integer, con1_f2 integer, con1_f3 varchar(20));
+    EXEC SQL AT con2 CREATE TABLE tb1 (con2_f1 integer, con2_f2 integer, con2_f3 varchar(20));
+    EXEC SQL AT con3 CREATE TABLE tb1 (con3_f1 integer, con3_f2 integer, con3_f3 varchar(20));
+
+    EXEC SQL AT con1 CREATE TABLE target (f1 integer, f2 integer, f3 varchar(20));
+    EXEC SQL AT con2 CREATE TABLE target (f1 integer, f2 integer, f3 varchar(20));
+    EXEC SQL AT con3 CREATE TABLE target (f1 integer, f2 integer, f3 varchar(20));
+
+
+
+    EXEC SQL AT con1 INSERT INTO source VALUES(1,10,'db on con1');
+    EXEC SQL AT con1 INSERT INTO source VALUES(2,20,'db on con1');
+    EXEC SQL AT con1 INSERT INTO source VALUES(3,30,'db on con1');
+
+    EXEC SQL AT con2 INSERT INTO source VALUES(1,10,'db on con2');
+    EXEC SQL AT con2 INSERT INTO source VALUES(2,20,'db on con2');
+    EXEC SQL AT con2 INSERT INTO source VALUES(3,30,'db on con2');
+
+    EXEC SQL AT con3 INSERT INTO source VALUES(1,10,'db on con3');
+    EXEC SQL AT con3 INSERT INTO source VALUES(2,20,'db on con3');
+    EXEC SQL AT con3 INSERT INTO source VALUES(3,30,'db on con3');
+
+    commitTable();
+
+    return 0;
+}
+
+/*
+ * success -- 0
+ * failed -- -1
+ */
+void dropTable()
+{
+    EXEC SQL AT con1 DROP TABLE IF EXISTS source;
+    EXEC SQL AT con2 DROP TABLE IF EXISTS source;
+    EXEC SQL AT con3 DROP TABLE IF EXISTS source;
+
+    EXEC SQL AT con1 DROP TABLE IF EXISTS target;
+    EXEC SQL AT con2 DROP TABLE IF EXISTS target;
+    EXEC SQL AT con3 DROP TABLE IF EXISTS target;
+
+    EXEC SQL AT con1 DROP TABLE IF EXISTS tb1;
+    EXEC SQL AT con2 DROP TABLE IF EXISTS tb1;
+    EXEC SQL AT con3 DROP TABLE IF EXISTS tb1;
+
+    commitTable();
+}
+
+void reCreateTable()
+{
+    dropTable();
+    createTable();
+}
+
+void truncateTable()
+{
+    EXEC SQL AT con1 TRUNCATE TABLE target;
+    EXEC SQL AT con2 TRUNCATE TABLE target;
+    EXEC SQL AT con3 TRUNCATE TABLE target;
+
+    commitTable();
+}
+
+void commitTable()
+{
+    EXEC SQL AT con1 COMMIT;
+    EXEC SQL AT con2 COMMIT;
+    EXEC SQL AT con3 COMMIT;
+}
+
+/*
+ * reset all the output variables
+ */
+void reset()
+{
+    int i;
+
+    truncateTable();
+
+    memset(f1,0,sizeof(f1));
+    memset(f2,0,sizeof(f2));
+    memset(f3,0,sizeof(f3));
+
+    for(i=0; i<COLUMN_NUM; i++)
+    {
+        memset(field_name[i],0, FIELD_NAME_LEN);
+    }
+}
+
+int initValues()
+{
+    return 0;
+}
+
+void releaseValues()
+{
+}
+
+void printResultF123(char *tc_name, int loop)
+{
+    int i;
+
+    if(loop>OUT_ARRAY_SZIE)
+    {
+        loop = OUT_ARRAY_SZIE;
+    }
+
+    if(tc_name)
+    {
+        printf("****%s test results:****\n",tc_name);
+    }
+
+    for (i = 0; i < loop; i++)
+        printf("f1=%d, f2=%d, f3=%s\n", f1[i], f2[i], f3[i]);
+
+    printf("\n");
+}
+
+void printResultIndF123(char *tc_name, int loop)
+{
+    int i;
+
+    if(loop>OUT_ARRAY_SZIE)
+    {
+        loop = OUT_ARRAY_SZIE;
+    }
+
+    if(tc_name)
+    {
+        printf("****%s indicator results:****\n",tc_name);
+    }
+
+    for (i = 0; i < loop; i++)
+        printf("ind_f1=%d, ind_f2=%d, ind_f3=%d\n", ind_f1[i], ind_f2[i], ind_f3[i]);
+
+    printf("\n");
+}
+
+void printFieldName(char *tc_name)
+{
+    int i;
+
+    if(tc_name)
+    {
+        printf("****%s test results:****\n",tc_name);
+    }
+
+    for (i = 0; i < COLUMN_NUM; i++)
+    {
+        printf("field[%d]'s name = %s\n", i, field_name[i]);
+    }
+
+    printf("\n");
+}
