commit fdb4a55237c18ae4b69969a487c8f6fe6c177f38
Author: Böszörményi Zoltán <zboszor@pr.hu>
Date:   Wed Apr 16 10:30:26 2014 +0200

    ECPG: Allow overriding the cursor readahead window size using
    an environment variable for cursors where READAHEAD N was not
    explicitly specified. Preprocessed C source of some regression
    tests have changed.

diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml
index ddcb93f..eb5431b 100644
--- a/doc/src/sgml/ecpg.sgml
+++ b/doc/src/sgml/ecpg.sgml
@@ -458,21 +458,24 @@ EXEC SQL COMMIT;
    details.
   </para>
 
   <para>
    ECPG does cursor accounting in its runtime library and this makes possible
    to do readahead to improve performance of programs that use single-row FETCH
    statements. The default is 1 row window size, i.e. no readahead.
    Option <option>-r readahead=number</option> on the ECPG command line modifies
    the default readahead window size for all cursors. Explicit
    <literal>READAHEAD number</literal> sets the readahead window size for
-   the specified cursor.
+   the specified cursor. If this clause is not explicitly specified for a cursor
+   (option <option>-r readahead=number</option> is considered implicit), then
+   setting the <literal>ECPGFETCHSZ</literal> environment variable overrides
+   the readahead window size for all such cursors.
   </para>
 
   <para>
    To execute an UPDATE or DELETE statement bearing the <literal>WHERE CURRENT OF</literal>
    clause, ECPG may first execute an implicit MOVE to synchronize the server
    cursor position with the local cursor position.  This can reduce or
    eliminate the performance benefit of readahead for affected cursors.
    For this reason, <literal>READAHEAD 1</literal> is recommended.
   </para>
 
diff --git a/src/interfaces/ecpg/ecpglib/cursor.c b/src/interfaces/ecpg/ecpglib/cursor.c
index 648caa0..aa74cdc 100644
--- a/src/interfaces/ecpg/ecpglib/cursor.c
+++ b/src/interfaces/ecpg/ecpglib/cursor.c
@@ -8,20 +8,26 @@
 #include "postgres_fe.h"
 
 #include <stdlib.h>
 #include <limits.h>
 
 #include "ecpgtype.h"
 #include "ecpglib.h"
 #include "ecpgerrno.h"
 #include "extern.h"
 
+static bool	envvars_read = false;	/* the variables below are already
+					   initialized */
+static int	default_fetch_size = -1;/* use this value instead of the
+					   passed-in per-cursor window size.
+					   -1 means unset. */
+
 static char *ecpg_cursor_direction_sql_name[] = {
 	"absolute",
 	"relative",
 	"forward",
 	"backward",
 	"absolute",
 	"relative",
 	"forward",
 	"backward"
 };
@@ -284,21 +290,21 @@ ecpg_commit_cursors(int lineno, struct connection * conn,
 /*
  * Declare the cursor in the backend and create a descriptor to make tracking
  * and cursor readahead possible.
  *
  * This function is called when the ECPG code OPENs the cursor.
  */
 bool
 ECPGopen(const int lineno, const int compat, const int force_indicator,
 			const char *connection_name, const bool questionmarks,
 			const bool with_hold, enum ECPG_cursor_scroll scrollable,
-			long readahead,
+			long readahead, const bool allow_ra_override,
 			const char *curname, const int st, const char *query, ...)
 {
 	struct connection *con = ecpg_get_connection(connection_name);
 	struct statement *stmt;
 	int		subxact_level;
 	va_list		args;
 
 	if (curname == NULL)
 	{
 		ecpg_raise(lineno, ECPG_INVALID_CURSOR, ECPG_SQLSTATE_INVALID_CURSOR_NAME, ecpg_gettext("<empty>"));
@@ -349,28 +355,59 @@ ECPGopen(const int lineno, const int compat, const int force_indicator,
 	}
 
 	if (!ecpg_process_output(stmt, 0, PQntuples(stmt->results), LOOP_FORWARD, 0, true, false))
 	{
 		ecpg_do_epilogue(stmt);
 		return false;
 	}
 
 	ecpg_do_epilogue(stmt);
 
+	/* Process the environment variables only once */
+	if (!envvars_read)
+	{
+		char	   *tmp, *endptr;
+		long		fetch_size_env;
+
+		/*
+		 * If ECPGFETCHSZ is set, interpret it.
+		 * - If invalid or unset, ignore. Leave default_fetch_size == -1
+		 * - If ECPGFETCHSZ <= 0, caching is disabled (readahead = 1)
+		 * - Otherwise use the actual number
+		 */
+		tmp = getenv("ECPGFETCHSZ");
+		if (tmp)
+		{
+			fetch_size_env = strtol(tmp, &endptr, 10);
+			if (*endptr)
+				fetch_size_env = -1;
+			else
+			{
+				/* Readahead disabled */
+				if (fetch_size_env <= 0)
+					fetch_size_env = 1;
+			}
+			default_fetch_size = fetch_size_env;
+		}
+		envvars_read = true;
+	}
+
 	/* Finally add the cursor to the connection. */
 	if (con->subxact_desc)
 		subxact_level = con->subxact_desc->level;
 	else
 		subxact_level =
 			(PQtransactionStatus(con->connection) != PQTRANS_IDLE ?
 										1 : 0);
-	add_cursor(lineno, con, curname, subxact_level, with_hold, scrollable, readahead);
+	add_cursor(lineno, con, curname, subxact_level, with_hold, scrollable,
+					(allow_ra_override && default_fetch_size >= 1 ?
+						default_fetch_size : readahead));
 
 	return true;
 }
 
 /*
  * Canonicalize the amount of cursor movement.
  */
 static bool
 ecpg_canonical_cursor_movement(enum ECPG_cursor_direction *direction, const char *amount,
 				bool *fetchall, int64 *amount_out)
diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h
index 76735a0..6fb7755 100644
--- a/src/interfaces/ecpg/include/ecpglib.h
+++ b/src/interfaces/ecpg/include/ecpglib.h
@@ -58,21 +58,21 @@ bool		ECPGprepare(int, const char *, const bool, const char *, const char *);
 bool		ECPGdeallocate(int, int, const char *, const char *);
 bool		ECPGdeallocate_all(int, int, const char *);
 char	   *ECPGprepared_statement(const char *, const char *, int);
 PGconn	   *ECPGget_PGconn(const char *);
 PGTransactionStatusType ECPGtransactionStatus(const char *);
 
 char	   *ECPGerrmsg(void);
 
 /* Cursor functions */
 bool		ECPGopen(const int, const int, const int, const char *, const bool, const bool,
-				enum ECPG_cursor_scroll, long readahead,
+				enum ECPG_cursor_scroll, long, const bool,
 				const char *, const int, const char *, ...);
 bool		ECPGfetch(const int, const int, const int, const char *, const bool,
 				enum ECPG_cursor_direction, const char *, bool,
 				const char *, const int, const char *, ...);
 bool		ECPGcursor_dml(const int, const int, const int, const char *, const bool,
 				const char *, const int, const char *, ...);
 bool		ECPGclose(const int, const int, const int, const char *, const bool,
 				const char *, const int, const char *, ...);
 
  /* print an error message */
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 0f36d6f..d55c9bf 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -525,28 +525,32 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsopt_readaheadCURSORopt_ho
 
 		this = (struct cursor *) mm_alloc(sizeof(struct cursor));
 
 		this->next = cur;
 		this->name = $2;
 		this->function = (current_function ? mm_strdup(current_function) : NULL);
 		this->connection = connection;
 		this->opened = false;
 		this->with_hold = (strncmp($6, "with ", 5) == 0);
 		if (strcmp($4, "default") == 0)
+		{
+			this->allow_ra_override = true;
 			this->fetch_readahead = fetch_readahead;
+		}
 		else
 		{
 			int	this_readahead = atoi($4);
 
 			if (this_readahead < 1)
 				mmerror(PARSE_ERROR, ET_ERROR, "cursor readahead cannot be less than 1");
-			this->fetch_readahead = atoi($4);
+			this->allow_ra_override = false;
+			this->fetch_readahead = this_readahead;
 		}
 		this->vartype = current_cursor_vartype;
 		if (current_cursor_scrollable == ECPGcs_unspecified)
 		{
 			this->scrollable = ECPGcs_no_scroll;
 			this->command =  cat_str(8, mm_strdup("declare"), cursor_marker, $3, mm_strdup("no scroll"), mm_strdup("cursor"), $6, mm_strdup("for"), $8);
 		}
 		else
 		{
 			this->scrollable = current_cursor_scrollable;
diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer
index 9fe47ee..80dd909 100644
--- a/src/interfaces/ecpg/preproc/ecpg.trailer
+++ b/src/interfaces/ecpg/preproc/ecpg.trailer
@@ -311,27 +311,31 @@ ECPGCursorStmt:	DECLARE cursor_name cursor_options opt_readahead CURSOR opt_hold
 			this = (struct cursor *) mm_alloc(sizeof(struct cursor));
 
 			/* initial definition */
 			this->next = cur;
 			this->name = $2;
 			this->function = (current_function ? mm_strdup(current_function) : NULL);
 			this->connection = connection;
 			this->opened = false;
 			this->with_hold = (strncmp($6, "with ", 5) == 0);
 			if (strcmp($4, "default") == 0)
+			{
+				this->allow_ra_override = true;
 				this->fetch_readahead = fetch_readahead;
+			}
 			else
 			{
 				int	this_readahead = atoi($4);
 
 				if (this_readahead < 1)
 					mmerror(PARSE_ERROR, ET_ERROR, "cursor readahead cannot be less than 1");
+				this->allow_ra_override = false;
 				this->fetch_readahead = this_readahead;
 			}
 			this->vartype = current_cursor_vartype;
 			if (current_cursor_scrollable == ECPGcs_unspecified)
 			{
 				this->scrollable = ECPGcs_no_scroll;
 				this->command =  cat_str(7, mm_strdup("declare"), cursor_marker, $3, mm_strdup("no scroll"), mm_strdup("cursor"), $6, mm_strdup("for $1"));
 			}
 			else
 			{
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c
index 8d0c3a5..5a206cc 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -236,24 +236,24 @@ output_deallocate_prepare_statement(char *name)
 	free(name);
 	if (connection != NULL)
 		free(connection);
 }
 
 void
 output_open_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
 {
 	struct cursor *ptr = get_cursor(current_cursor);
 
-	fprintf(yyout, "{ ECPGopen(__LINE__, %d, %d, %s, %d, %d, %s, %ld, ",
+	fprintf(yyout, "{ ECPGopen(__LINE__, %d, %d, %s, %d, %d, %s, %ld, %d, ",
 						compat, force_indicator, connection ? connection : "NULL", questionmarks,
 						ptr->with_hold, ecpg_cursor_scroll_name[ptr->scrollable],
-						ptr->fetch_readahead);
+						ptr->fetch_readahead, ptr->allow_ra_override);
 	output_cursor_name(ptr);
 	output_statement_epilogue(stmt, whenever_mode, st);
 }
 
 void
 output_fetch_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st, bool move)
 {
 	struct cursor *ptr = get_cursor(current_cursor);
 	char	   *amount;
 
diff --git a/src/interfaces/ecpg/preproc/type.h b/src/interfaces/ecpg/preproc/type.h
index 50a6057..be93397 100644
--- a/src/interfaces/ecpg/preproc/type.h
+++ b/src/interfaces/ecpg/preproc/type.h
@@ -123,20 +123,21 @@ struct _include_path
 };
 
 struct cursor
 {
 	char	   *name;
 	char	   *function;
 	char	   *command;
 	char	   *connection;
 	bool		opened;
 	bool		with_hold;
+	bool		allow_ra_override;
 	long		fetch_readahead;
 	enum ECPGttype	vartype;
 	enum ECPG_cursor_scroll scrollable;
 	struct arguments *argsinsert;
 	struct arguments *argsinsert_oos;
 	struct arguments *argsresult;
 	struct arguments *argsresult_oos;
 	struct cursor *next;
 };
 
diff --git a/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c b/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
index 1b343d1..5488511 100644
--- a/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
+++ b/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
@@ -234,21 +234,21 @@ if (sqlca.sqlcode < 0) exit (1);}
 if (sqlca.sqlcode < 0) exit (1);}
 #line 95 "sqlda.pgc"
 
 
 	strcpy(msg, "declare");
 	ECPG_informix_reset_sqlca(); /* declare mycur1 no scroll cursor for $1 */
 #line 98 "sqlda.pgc"
 
 
 	strcpy(msg, "open");
-	{ ECPGopen(__LINE__, 1, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "mycur1", ECPGst_normal, "declare mycur1 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 1, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "mycur1", ECPGst_normal, "declare mycur1 no scroll 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"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 101 "sqlda.pgc"
 
 
 	/* exec sql whenever not found  break ; */
 #line 103 "sqlda.pgc"
@@ -309,21 +309,21 @@ if (sqlca.sqlcode < 0) exit (1);}
 if (sqlca.sqlcode < 0) exit (1);}
 #line 132 "sqlda.pgc"
 
 
 	strcpy(msg, "declare");
 	ECPG_informix_reset_sqlca(); /* declare mycur2 no scroll cursor for $1 */
 #line 135 "sqlda.pgc"
 
 
 	strcpy(msg, "open");
-	{ ECPGopen(__LINE__, 1, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "mycur2", ECPGst_normal, "declare mycur2 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 1, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "mycur2", ECPGst_normal, "declare mycur2 no scroll 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"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 138 "sqlda.pgc"
 
 
 	/* exec sql whenever not found  break ; */
 #line 140 "sqlda.pgc"
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 430eb4e..c4be5cd 100644
--- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c
+++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c
@@ -237,19 +237,19 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
 
 if (sqlca.sqlcode < 0) dosqlprint ( );}
 #line 88 "test_informix.pgc"
 
 
 	return 0;
 }
 
 static void openit(void)
 {
-	{ ECPGopen(__LINE__, 1, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "c", ECPGst_normal, "declare c no scroll cursor for select * from test where i <= $1 ", 
+	{ ECPGopen(__LINE__, 1, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "c", ECPGst_normal, "declare c no scroll 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"
 
 if (sqlca.sqlcode < 0) dosqlprint ( );}
 #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 4f57003..de73001 100644
--- a/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
+++ b/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
@@ -75,21 +75,21 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 )", ECPGt_EOIT, ECPGt_EORT);
 #line 31 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
 #line 31 "nan_test.pgc"
 
 
 	/* declare cur no scroll cursor for select id , d , d from nantest1 */
 #line 33 "nan_test.pgc"
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "cur", ECPGst_normal, "declare cur no scroll cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "cur", ECPGst_normal, "declare cur no scroll cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
 #line 34 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
 #line 34 "nan_test.pgc"
 
 	while (1)
 	{
 		{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_forward, "1", 0, "cur", ECPGst_normal, "fetch from cur", ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
@@ -130,21 +130,21 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 #line 46 "nan_test.pgc"
 
 	}
 	{ ECPGclose(__LINE__, 0, 1, NULL, 0, "cur", ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
 #line 48 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
 #line 48 "nan_test.pgc"
 
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "cur", ECPGst_normal, "declare cur no scroll cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "cur", ECPGst_normal, "declare cur no scroll cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
 #line 50 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
 #line 50 "nan_test.pgc"
 
 	while (1)
 	{
 		{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_forward, "1", 0, "cur", ECPGst_normal, "fetch from cur", ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
@@ -214,21 +214,21 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 73 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
 #line 73 "nan_test.pgc"
 
 
 	/* declare cur1 no scroll cursor for select id , d , d from nantest2 */
 #line 75 "nan_test.pgc"
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "cur1", ECPGst_normal, "declare cur1 no scroll cursor for select id , d , d from nantest2", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "cur1", ECPGst_normal, "declare cur1 no scroll cursor for select id , d , d from nantest2", ECPGt_EOIT, ECPGt_EORT);
 #line 76 "nan_test.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint ( );}
 #line 76 "nan_test.pgc"
 
 	while (1)
 	{
 		{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_forward, "1", 0, "cur1", ECPGst_normal, "fetch from cur1", ECPGt_EOIT, 
 	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
diff --git a/src/interfaces/ecpg/test/expected/preproc-autoprep.c b/src/interfaces/ecpg/test/expected/preproc-autoprep.c
index 9b475a7..873539f 100644
--- a/src/interfaces/ecpg/test/expected/preproc-autoprep.c
+++ b/src/interfaces/ecpg/test/expected/preproc-autoprep.c
@@ -126,21 +126,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 30 "autoprep.pgc"
 
 
   for (i=0; i<4; i++)
 	printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
 
   /* declare C no scroll cursor for select Item1 from T */
 #line 35 "autoprep.pgc"
 
 
-  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "C", ECPGst_normal, "declare C no scroll cursor for select Item1 from T", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "C", ECPGst_normal, "declare C no scroll cursor for select Item1 from T", ECPGt_EOIT, ECPGt_EORT);
 #line 37 "autoprep.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
 #line 37 "autoprep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 37 "autoprep.pgc"
 
 
   { ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_forward, "1", 0, "C", ECPGst_normal, "fetch 1 in C", ECPGt_EOIT, 
@@ -173,21 +173,21 @@ if (sqlca.sqlwarn[0] == 'W') sqlprint();
 #line 44 "autoprep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 44 "autoprep.pgc"
 
 
   /* declare cur1 no scroll cursor for $1 */
 #line 46 "autoprep.pgc"
 
 
-  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "cur1", ECPGst_normal, "declare cur1 no scroll cursor for $1", 
+  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "cur1", ECPGst_normal, "declare cur1 no scroll 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"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
 #line 48 "autoprep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 48 "autoprep.pgc"
 
diff --git a/src/interfaces/ecpg/test/expected/preproc-cursor.c b/src/interfaces/ecpg/test/expected/preproc-cursor.c
index 94c91d2..fd47a91 100644
--- a/src/interfaces/ecpg/test/expected/preproc-cursor.c
+++ b/src/interfaces/ecpg/test/expected/preproc-cursor.c
@@ -180,21 +180,21 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	/* Dynamic cursorname test with INTO list in FETCH stmts */
 
 	strcpy(msg, "declare");
 	ECPGset_var( 0, &( curname1 ), __LINE__);\
  /* declare $0 no scroll cursor for select id , t from t1 */
 #line 64 "cursor.pgc"
 
 
 	strcpy(msg, "open");
-	{ ECPGopen(__LINE__, 0, 1, "test1", 0, 0, ECPGcs_no_scroll, 1, curname1, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
+	{ ECPGopen(__LINE__, 0, 1, "test1", 0, 0, ECPGcs_no_scroll, 1, 1, curname1, ECPGst_normal, "declare $0 no scroll 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"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 67 "cursor.pgc"
 
 
 	strcpy(msg, "fetch from");
 	{ ECPGfetch(__LINE__, 0, 1, "test1", 0, ECPGc_forward, "1", 0, curname1, ECPGst_normal, "fetch forward from $0", 
@@ -316,21 +316,21 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	strcpy(msg, "declare");
 	ECPGset_var( 1, &( curname2 ), __LINE__);\
  ECPGset_var( 2, ( t ), __LINE__);\
  ECPGset_var( 3, &( id ), __LINE__);\
  /* declare $0 no scroll cursor for select id , t from t1 */
 #line 105 "cursor.pgc"
 
 
 	strcpy(msg, "open");
-	{ ECPGopen(__LINE__, 0, 1, "test1", 0, 0, ECPGcs_no_scroll, 1, curname2, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
+	{ ECPGopen(__LINE__, 0, 1, "test1", 0, 0, ECPGcs_no_scroll, 1, 1, curname2, ECPGst_normal, "declare $0 no scroll 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), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,(t),(long)64,(long)1,(64)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
 #line 108 "cursor.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 108 "cursor.pgc"
@@ -476,31 +476,31 @@ if (sqlca.sqlcode < 0) exit (1);}
 	ECPGset_var( 4, &( curname3 ), __LINE__);\
  /* declare $0 no scroll cursor for $1 */
 #line 149 "cursor.pgc"
 
 	ECPGset_var( 5, &( curname5 ), __LINE__);\
  /* declare $0 no scroll cursor for $1 */
 #line 150 "cursor.pgc"
 
 
 	strcpy(msg, "open");
-	{ ECPGopen(__LINE__, 0, 1, "test1", 0, 0, ECPGcs_no_scroll, 1, curname3, ECPGst_normal, "declare $0 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, "test1", 0, 0, ECPGcs_no_scroll, 1, 1, curname3, ECPGst_normal, "declare $0 no scroll 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), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 153 "cursor.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 153 "cursor.pgc"
 
-	{ ECPGopen(__LINE__, 0, 1, "test2", 0, 0, ECPGcs_no_scroll, 1, curname5, ECPGst_normal, "declare $0 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, "test2", 0, 0, ECPGcs_no_scroll, 1, 1, curname5, ECPGst_normal, "declare $0 no scroll 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), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 154 "cursor.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 154 "cursor.pgc"
 
 
@@ -656,21 +656,21 @@ if (sqlca.sqlcode < 0) exit (1);}
 #line 200 "cursor.pgc"
 
 
 	strcpy(msg, "declare");
 	ECPGset_var( 6, &( curname4 ), __LINE__);\
  /* declare $0 no scroll cursor for $1 */
 #line 203 "cursor.pgc"
 
 
 	strcpy(msg, "open");
-	{ ECPGopen(__LINE__, 0, 1, "test1", 0, 0, ECPGcs_no_scroll, 1, curname4.arr, ECPGst_normal, "declare $0 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, "test1", 0, 0, ECPGcs_no_scroll, 1, 1, curname4.arr, ECPGst_normal, "declare $0 no scroll 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), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 206 "cursor.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 206 "cursor.pgc"
 
 
diff --git a/src/interfaces/ecpg/test/expected/preproc-outofscope.c b/src/interfaces/ecpg/test/expected/preproc-outofscope.c
index b99946d..4969a05 100644
--- a/src/interfaces/ecpg/test/expected/preproc-outofscope.c
+++ b/src/interfaces/ecpg/test/expected/preproc-outofscope.c
@@ -194,21 +194,21 @@ get_var1(MYTYPE **myvar0, MYNULLTYPE **mynullvar0)
 	if (sqlca.sqlcode != 0)
 		exit(1);
 
 	*myvar0 = myvar;
 	*mynullvar0 = mynullvar;
 }
 
 static void
 open_cur1(void)
 {
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "mycur", ECPGst_normal, "declare mycur no scroll cursor for select * from a1", ECPGt_EOIT, 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "mycur", ECPGst_normal, "declare mycur no scroll 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 ), 
 	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1)) ).t),(long)1,(long)1,sizeof( struct mynulltype ), 
 	ECPGt_double,&((*( MYTYPE  *)(ECPGget_var( 0)) ).d1),(long)1,(long)1,sizeof( struct mytype ), 
 	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1)) ).d1),(long)1,(long)1,sizeof( struct mynulltype ), 
 	ECPGt_double,&((*( MYTYPE  *)(ECPGget_var( 0)) ).d2),(long)1,(long)1,sizeof( struct mytype ), 
 	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1)) ).d2),(long)1,(long)1,sizeof( struct mynulltype ), 
 	ECPGt_char,&((*( MYTYPE  *)(ECPGget_var( 0)) ).c),(long)30,(long)1,sizeof( struct mytype ), 
 	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1)) ).c),(long)1,(long)1,sizeof( struct mynulltype ), ECPGt_EORT);
diff --git a/src/interfaces/ecpg/test/expected/preproc-variable.c b/src/interfaces/ecpg/test/expected/preproc-variable.c
index fdbdb68..4fc5906 100644
--- a/src/interfaces/ecpg/test/expected/preproc-variable.c
+++ b/src/interfaces/ecpg/test/expected/preproc-variable.c
@@ -183,21 +183,21 @@ if (sqlca.sqlcode < 0) exit (1);}
 
 	strcpy(msg, "commit");
 	{ ECPGtrans(__LINE__, NULL, "commit", 0, 0, 0, NULL);
 #line 60 "variable.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 60 "variable.pgc"
 
 
 	strcpy(msg, "open");
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "cur", ECPGst_normal, "declare cur no scroll cursor for select name , born , age , married , children from family", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "cur", ECPGst_normal, "declare cur no scroll cursor for select name , born , age , married , children from family", ECPGt_EOIT, ECPGt_EORT);
 #line 63 "variable.pgc"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 63 "variable.pgc"
 
 
 	/* exec sql whenever not found  break ; */
 #line 65 "variable.pgc"
 
 
diff --git a/src/interfaces/ecpg/test/expected/sql-binary.c b/src/interfaces/ecpg/test/expected/sql-binary.c
index 4bcb9a7..0538925 100644
--- a/src/interfaces/ecpg/test/expected/sql-binary.c
+++ b/src/interfaces/ecpg/test/expected/sql-binary.c
@@ -104,21 +104,21 @@ main (void)
   if (sqlca.sqlcode)
     {
       printf ("insert error = %ld\n", sqlca.sqlcode);
       exit (sqlca.sqlcode);
     }
 
   ECPGset_var( 0, &( empl.idnum ), __LINE__);\
  /* declare C no scroll cursor for select name , accs , byte from empl where idnum = $1  */
 #line 58 "binary.pgc"
 
-  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "C", ECPGst_normal, "declare C no scroll cursor for select name , accs , byte from empl where idnum = $1 ", 
+  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "C", ECPGst_normal, "declare C no scroll 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"
 
   { ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_forward, "1", 0, "C", 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), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,(empl.byte),(long)20,(long)1,(20)*sizeof(char), 
@@ -135,21 +135,21 @@ main (void)
 
   { ECPGclose(__LINE__, 0, 1, NULL, 0, "C", ECPGst_normal, "close C", ECPGt_EOIT, ECPGt_EORT);}
 #line 69 "binary.pgc"
 
 
   memset(empl.name, 0, 21L);
   ECPGset_var( 1, &( empl.idnum ), __LINE__);\
  /* declare B binary no scroll cursor for select name , accs , byte from empl where idnum = $1  */
 #line 72 "binary.pgc"
 
-  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "B", ECPGst_normal, "declare B binary no scroll cursor for select name , accs , byte from empl where idnum = $1 ", 
+  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "B", ECPGst_normal, "declare B binary no scroll 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"
 
   { ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_forward, "1", 0, "B", 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), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 	ECPGt_char,(empl.byte),(long)20,(long)1,(20)*sizeof(char), 
@@ -169,21 +169,21 @@ main (void)
   /* do not print a.accs because big/little endian will have different outputs here */
   printf ("name=%s, byte=", empl.name);
   for (i=0; i<4; i++)
 	printf("(%o)", (unsigned char)empl.byte[i]);
   printf("\n");
 
   ECPGset_var( 2, &( empl.idnum ), __LINE__);\
  /* declare A binary no scroll cursor for select byte from empl where idnum = $1  */
 #line 89 "binary.pgc"
 
-  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "A", ECPGst_normal, "declare A binary no scroll cursor for select byte from empl where idnum = $1 ", 
+  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "A", ECPGst_normal, "declare A binary no scroll 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"
 
   { ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_forward, "1", 0, "A", 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"
 
   if (sqlca.sqlcode)
diff --git a/src/interfaces/ecpg/test/expected/sql-cursor-ra-fetch.c b/src/interfaces/ecpg/test/expected/sql-cursor-ra-fetch.c
index 800da8f..47ded6b 100644
--- a/src/interfaces/ecpg/test/expected/sql-cursor-ra-fetch.c
+++ b/src/interfaces/ecpg/test/expected/sql-cursor-ra-fetch.c
@@ -76,21 +76,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 29 "cursor-ra-fetch.pgc"
 
 
 	/*
 	 * Test FETCH ABSOLUTE N with an interval of 4 using positive positions.
 	 * Readahead is 8 so caching is in effect.
 	 */
 
 	printf("test scroll_cur for move absolute n (every 4th tuple forward, positive positions)\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, 0, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 38 "cursor-ra-fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 38 "cursor-ra-fetch.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	for (i = 1; i < 33; i += 4)
 	{
@@ -143,21 +143,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 64 "cursor-ra-fetch.pgc"
 
 
 	/*
 	 * Test FETCH ABSOLUTE N with an interval of 4 using negative positions.
 	 * Readahead is 8 so caching is in effect.
 	 */
 
 	printf("\ntest scroll_cur for move absolute n (every 4th tuple backward, negative positions)\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, 0, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 73 "cursor-ra-fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 73 "cursor-ra-fetch.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	for (i = -1; i > -33; i -= 4)
 	{
@@ -210,21 +210,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 99 "cursor-ra-fetch.pgc"
 
 
 	/*
 	 * Test FETCH RELATIVE +/- 4 using positive positions
 	 * readahead is 8, so caching is in effect
 	 */
 
 	printf("\ntest scroll_cur for fetch relative 4 (positive positions)\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, 0, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 108 "cursor-ra-fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 108 "cursor-ra-fetch.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	quit_loop = 0;
 	while (!quit_loop)
@@ -283,21 +283,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 144 "cursor-ra-fetch.pgc"
 
 
 	/*
 	 * Test FETCH RELATIVE +/- 4 using negative positions
 	 * readahead is 8, so caching is in effect
 	 */
 
 	printf("\ntest scroll_cur for fetch relative -4 (negative positions)\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, 0, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 153 "cursor-ra-fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 153 "cursor-ra-fetch.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_absolute, "- 1", 1, "scroll_cur", ECPGst_normal, "move absolute - 1 in scroll_cur", ECPGt_EOIT, ECPGt_EORT);
 #line 157 "cursor-ra-fetch.pgc"
@@ -373,21 +373,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 196 "cursor-ra-fetch.pgc"
 
 
 	/*
 	 * Test FETCH FORWARD +/- 4 using positive positions
 	 * readahead is 8, so caching is in effect
 	 */
 
 	printf("\ntest scroll_cur for fetch forward 4 (positive positions)\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, 0, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 205 "cursor-ra-fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 205 "cursor-ra-fetch.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	quit_loop = 0;
 	while (!quit_loop)
@@ -446,21 +446,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 241 "cursor-ra-fetch.pgc"
 
 
 	/*
 	 * Test FETCH FORWARD +/- 4 using negative positions
 	 * readahead is 8, so caching is in effect
 	 */
 
 	printf("\ntest scroll_cur for fetch forward -4 (negative positions)\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, 0, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 250 "cursor-ra-fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 250 "cursor-ra-fetch.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_absolute, "- 1", 1, "scroll_cur", ECPGst_normal, "move absolute - 1 in scroll_cur", ECPGt_EOIT, ECPGt_EORT);
 #line 254 "cursor-ra-fetch.pgc"
@@ -537,21 +537,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 
 	/*
 	 * Test FETCH ABSOLUTE N with an interval of 5 using positive positions.
 	 * Readahead is 4 so cache misses occur.
 	 * ecpglib will switch to plain ecpg_execute after 3 cache misses
 	 */
 
 	printf("\ntest scroll_cur4 for move absolute n (every 5th tuple forward, positive positions)\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 4, "scroll_cur4", ECPGst_normal, "declare scroll_cur4 scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 4, 0, "scroll_cur4", ECPGst_normal, "declare scroll_cur4 scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 303 "cursor-ra-fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 303 "cursor-ra-fetch.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	for (i = 1; i < 35; i += 5)
 	{
@@ -648,21 +648,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 
 	/*
 	 * Test FETCH ABSOLUTE N with an interval of 5 using negative positions.
 	 * Readahead is 4 so cache misses occur.
 	 * ecpglib will switch to plain ecpg_execute after 3 cache misses
 	 */
 
 	printf("\ntest scroll_cur4 for move absolute n (every 5th tuple backward, negative positions)\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 4, "scroll_cur4", ECPGst_normal, "declare scroll_cur4 scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 4, 0, "scroll_cur4", ECPGst_normal, "declare scroll_cur4 scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 364 "cursor-ra-fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 364 "cursor-ra-fetch.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	for (i = -1; i > -35; i -= 5)
 	{
@@ -760,21 +760,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 
 	/*
 	 * Test FETCH RELATIVE +/- 5 using positive positions.
 	 * Readahead is 4 so cache misses occur.
 	 * ecpglib will switch to plain ecpg_execute after 3 cache misses
 	 */
 
 	printf("\ntest scroll_cur4 for fetch relative 5 (positive positions)\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 4, "scroll_cur4", ECPGst_normal, "declare scroll_cur4 scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 4, 0, "scroll_cur4", ECPGst_normal, "declare scroll_cur4 scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 426 "cursor-ra-fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 426 "cursor-ra-fetch.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	quit_loop = 0;
 	while (!quit_loop)
@@ -882,21 +882,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 
 	/*
 	 * Test FETCH RELATIVE +/- 5 using negative positions.
 	 * Readahead is 4 so cache misses occur.
 	 * ecpglib will switch to plain ecpg_execute after 3 cache misses
 	 */
 
 	printf("\ntest scroll_cur4 for move relative -5 (negative positions)\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 4, "scroll_cur4", ECPGst_normal, "declare scroll_cur4 scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 4, 0, "scroll_cur4", ECPGst_normal, "declare scroll_cur4 scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 497 "cursor-ra-fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 497 "cursor-ra-fetch.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_absolute, "- 1", 1, "scroll_cur4", ECPGst_normal, "move absolute - 1 in scroll_cur4", ECPGt_EOIT, ECPGt_EORT);
 #line 501 "cursor-ra-fetch.pgc"
diff --git a/src/interfaces/ecpg/test/expected/sql-cursor-ra-move.c b/src/interfaces/ecpg/test/expected/sql-cursor-ra-move.c
index 5a5dd70..ce5c03b 100644
--- a/src/interfaces/ecpg/test/expected/sql-cursor-ra-move.c
+++ b/src/interfaces/ecpg/test/expected/sql-cursor-ra-move.c
@@ -68,21 +68,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 27 "cursor-ra-move.pgc"
 
 	/* declare unspec_cur2 no scroll cursor for select t1 . id , t1 . t , t2 . id , t2 . t from t1 join t1 as t2 on ( t1 . id = 27 - t2 . id ) order by t1 . id */
 #line 28 "cursor-ra-move.pgc"
 
 
 	/* Test MOVE ABSOLUTE -1 for all 4 cursors */
 
 	printf("test scroll_cur for move absolute -1\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, 0, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 34 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 34 "cursor-ra-move.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_absolute, "- 1", 1, "scroll_cur", ECPGst_normal, "move absolute - 1 in scroll_cur", ECPGt_EOIT, ECPGt_EORT);
 #line 38 "cursor-ra-move.pgc"
@@ -97,21 +97,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 	{ ECPGtrans(__LINE__, NULL, "rollback", 0, 0, 1, NULL);
 #line 44 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 44 "cursor-ra-move.pgc"
 
 
 	printf("test noscroll_cur for move absolute -1\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 8, "noscroll_cur", ECPGst_normal, "declare noscroll_cur no scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 8, 0, "noscroll_cur", ECPGst_normal, "declare noscroll_cur no scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 48 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 48 "cursor-ra-move.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_absolute, "- 1", 1, "noscroll_cur", ECPGst_normal, "move absolute - 1 in noscroll_cur", ECPGt_EOIT, ECPGt_EORT);
 #line 52 "cursor-ra-move.pgc"
@@ -126,21 +126,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 	{ ECPGtrans(__LINE__, NULL, "rollback", 0, 0, 1, NULL);
 #line 58 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 58 "cursor-ra-move.pgc"
 
 
 	printf("test unspec_cur1 for move absolute -1\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 8, "unspec_cur1", ECPGst_normal, "declare unspec_cur1 no scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 8, 0, "unspec_cur1", ECPGst_normal, "declare unspec_cur1 no scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 62 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 62 "cursor-ra-move.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_absolute, "- 1", 1, "unspec_cur1", ECPGst_normal, "move absolute - 1 in unspec_cur1", ECPGt_EOIT, ECPGt_EORT);
 #line 66 "cursor-ra-move.pgc"
@@ -155,21 +155,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 	{ ECPGtrans(__LINE__, NULL, "rollback", 0, 0, 1, NULL);
 #line 72 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 72 "cursor-ra-move.pgc"
 
 
 	printf("test unspec_cur2 for move absolute -1\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 8, "unspec_cur2", ECPGst_normal, "declare unspec_cur2 no scroll cursor for select t1 . id , t1 . t , t2 . id , t2 . t from t1 join t1 as t2 on ( t1 . id = 27 - t2 . id ) order by t1 . id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 8, 0, "unspec_cur2", ECPGst_normal, "declare unspec_cur2 no scroll cursor for select t1 . id , t1 . t , t2 . id , t2 . t from t1 join t1 as t2 on ( t1 . id = 27 - t2 . id ) order by t1 . id", ECPGt_EOIT, ECPGt_EORT);
 #line 76 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 76 "cursor-ra-move.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_absolute, "- 1", 1, "unspec_cur2", ECPGst_normal, "move absolute - 1 in unspec_cur2", ECPGt_EOIT, ECPGt_EORT);
 #line 80 "cursor-ra-move.pgc"
@@ -186,21 +186,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 86 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 86 "cursor-ra-move.pgc"
 
 
 	/* Test MOVE RELATIVE 8 */
 
 	printf("test scroll_cur for move relative 8\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, 0, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 92 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 92 "cursor-ra-move.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	quit_loop = 0;
 	while (!quit_loop)
@@ -240,21 +240,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 120 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 120 "cursor-ra-move.pgc"
 
 
 	/* Test MOVE FORWARD 8 */
 
 	printf("test scroll_cur for move forward 8\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 8, 0, "scroll_cur", ECPGst_normal, "declare scroll_cur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 126 "cursor-ra-move.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 126 "cursor-ra-move.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open failed with SQLSTATE %5s\n", sqlca.sqlstate);
 
 	quit_loop = 0;
 	while (!quit_loop)
diff --git a/src/interfaces/ecpg/test/expected/sql-cursor-ra-swdir.c b/src/interfaces/ecpg/test/expected/sql-cursor-ra-swdir.c
index db04f60..bfc798f 100644
--- a/src/interfaces/ecpg/test/expected/sql-cursor-ra-swdir.c
+++ b/src/interfaces/ecpg/test/expected/sql-cursor-ra-swdir.c
@@ -150,21 +150,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 69 "cursor-ra-swdir.pgc"
 
 	{ ECPGtrans(__LINE__, NULL, "commit", 0, 0, 0, NULL);
 #line 70 "cursor-ra-swdir.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 70 "cursor-ra-swdir.pgc"
 
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 4, "mycur", ECPGst_normal, "declare mycur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 4, 0, "mycur", ECPGst_normal, "declare mycur scroll cursor for select id , t from t1 order by id", ECPGt_EOIT, ECPGt_EORT);
 #line 72 "cursor-ra-swdir.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 72 "cursor-ra-swdir.pgc"
 
 
 	printf("Discover total number of tuples and test flipping fetch directions\n");
 
 	/*
 	 * This part verifies that the returned rows are correct
diff --git a/src/interfaces/ecpg/test/expected/sql-cursorsubxact.c b/src/interfaces/ecpg/test/expected/sql-cursorsubxact.c
index d127d14..e331a9c 100644
--- a/src/interfaces/ecpg/test/expected/sql-cursorsubxact.c
+++ b/src/interfaces/ecpg/test/expected/sql-cursorsubxact.c
@@ -85,21 +85,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 	printf("test case insensitive cursor name\n\n");
 
 	curname = CURNAME;
 
 	ECPGset_var( 0, &( curname ), __LINE__);\
  /* declare $0 no scroll cursor for select id , t from t1 */
 #line 39 "cursorsubxact.pgc"
 
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
 	ECPGt_char,&(curname),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 41 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 41 "cursorsubxact.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open %s (case insensitive) failed with SQLSTATE %5s\n", curname, sqlca.sqlstate);
 	else
@@ -122,21 +122,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 	/*
 	 * Cursor name passed in a variable quoted.
 	 * It has to be treated as case-sensitive.
 	 */
 
 	printf("\ntest case sensitive cursor name\n\n");
 
 	curname = QUOTED_CURNAME;
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
 	ECPGt_char,&(curname),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 64 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 64 "cursorsubxact.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open %s (case sensitive) failed with SQLSTATE %5s\n", curname, sqlca.sqlstate);
 	else
@@ -189,21 +189,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 	curname = QUOTED_CURNAME;
 
 	{ ECPGtrans(__LINE__, NULL, "savepoint a", 0, 1, 0, "a");
 #line 98 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 98 "cursorsubxact.pgc"
 
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
 	ECPGt_char,&(curname),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 100 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 100 "cursorsubxact.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open %s (case sensitive) failed with SQLSTATE %5s\n", curname, sqlca.sqlstate);
 	else
@@ -250,21 +250,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 126 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 126 "cursorsubxact.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("\"savepoint a\" failed with SQLSTATE %5s\n", sqlca.sqlstate);
 	else
 		printf("\"savepoint a\" succeeded\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
 	ECPGt_char,&(curname),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 132 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 132 "cursorsubxact.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open %s (case sensitive) failed with SQLSTATE %5s\n", curname, sqlca.sqlstate);
 	else
@@ -425,21 +425,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 233 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 233 "cursorsubxact.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("\"savepoint a\" failed with SQLSTATE %5s\n", sqlca.sqlstate);
 	else
 		printf("\"savepoint a\" succeeded\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
 	ECPGt_char,&(curname),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 239 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 239 "cursorsubxact.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open %s (case sensitive) failed with SQLSTATE %5s\n", curname, sqlca.sqlstate);
 	else
@@ -492,21 +492,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 	if (sqlca.sqlcode < 0)
 		printf("fetch from %s (case sensitive) failed with SQLSTATE %5s (expected 34000)\n", curname, sqlca.sqlstate);
 	else
 		printf("fetch from %s (case sensitive) unexpectedly succeeded (expected 34000)\n", curname);
 
 	/*
 	 * Try to open it again, should fail because the
 	 * transaction has failed above.
 	 */
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
 	ECPGt_char,&(curname),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 272 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 272 "cursorsubxact.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open %s (case sensitive) failed with SQLSTATE %5s (expected 25P02)\n", curname, sqlca.sqlstate);
 	else
@@ -523,21 +523,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 285 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 285 "cursorsubxact.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("\"rollback to a\" failed with SQLSTATE %5s\n", sqlca.sqlstate);
 	else
 		printf("\"rollback to a\" succeeded\n");
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, curname, ECPGst_normal, "declare $0 no scroll cursor for select id , t from t1", 
 	ECPGt_char,&(curname),(long)0,(long)1,(1)*sizeof(char), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 291 "cursorsubxact.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 291 "cursorsubxact.pgc"
 
 	if (sqlca.sqlcode < 0)
 		printf("open %s (case sensitive) failed with SQLSTATE %5s\n", curname, sqlca.sqlstate);
 	else
diff --git a/src/interfaces/ecpg/test/expected/sql-desc.c b/src/interfaces/ecpg/test/expected/sql-desc.c
index 6871c29..86e4b48 100644
--- a/src/interfaces/ecpg/test/expected/sql-desc.c
+++ b/src/interfaces/ecpg/test/expected/sql-desc.c
@@ -242,21 +242,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 #line 55 "desc.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 55 "desc.pgc"
 
 	printf("output = %s\n", val2output);
 
 	/* declare c1 no scroll cursor for $1 */
 #line 58 "desc.pgc"
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "c1", ECPGst_normal, "declare c1 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "c1", ECPGst_normal, "declare c1 no scroll 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, 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 59 "desc.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 59 "desc.pgc"
 
 
@@ -292,21 +292,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
 #line 68 "desc.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 68 "desc.pgc"
 
 
 	/* declare c2 no scroll cursor for $1 */
 #line 70 "desc.pgc"
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "c2", ECPGst_normal, "declare c2 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "c2", ECPGst_normal, "declare c2 no scroll 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, 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 71 "desc.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 71 "desc.pgc"
 
 
diff --git a/src/interfaces/ecpg/test/expected/sql-dyntest.c b/src/interfaces/ecpg/test/expected/sql-dyntest.c
index f03102a..c5c878a 100644
--- a/src/interfaces/ecpg/test/expected/sql-dyntest.c
+++ b/src/interfaces/ecpg/test/expected/sql-dyntest.c
@@ -254,21 +254,21 @@ if (sqlca.sqlcode < 0) error ( );}
   { ECPGprepare(__LINE__, NULL, 0, "myquery", QUERY);
 #line 57 "dyntest.pgc"
 
 if (sqlca.sqlcode < 0) error ( );}
 #line 57 "dyntest.pgc"
 
   /* declare MYCURS no scroll cursor for $1 */
 #line 58 "dyntest.pgc"
 
 
-  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "MYCURS", ECPGst_normal, "declare MYCURS no scroll cursor for $1", 
+  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "MYCURS", ECPGst_normal, "declare MYCURS no scroll 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"
 
 if (sqlca.sqlcode < 0) error ( );}
 #line 60 "dyntest.pgc"
 
 
   while (1)
     {
diff --git a/src/interfaces/ecpg/test/expected/sql-execute.c b/src/interfaces/ecpg/test/expected/sql-execute.c
index d0e33b1..f7d4282 100644
--- a/src/interfaces/ecpg/test/expected/sql-execute.c
+++ b/src/interfaces/ecpg/test/expected/sql-execute.c
@@ -133,21 +133,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 	{ ECPGprepare(__LINE__, NULL, 0, "f", command);
 #line 49 "execute.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 49 "execute.pgc"
 
 	/* declare CUR no scroll cursor for $1 */
 #line 50 "execute.pgc"
 
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "CUR", ECPGst_normal, "declare CUR no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "CUR", ECPGst_normal, "declare CUR no scroll 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"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 52 "execute.pgc"
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_forward, "8", 0, "CUR", 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, 
@@ -198,21 +198,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 	{ ECPGprepare(__LINE__, NULL, 0, "f", command);
 #line 71 "execute.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 71 "execute.pgc"
 
 	/* declare CUR2 no scroll cursor for $1 */
 #line 72 "execute.pgc"
 
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "CUR2", ECPGst_normal, "declare CUR2 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "CUR2", ECPGst_normal, "declare CUR2 no scroll 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"), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 74 "execute.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 74 "execute.pgc"
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_forward, "1", 0, "CUR2", ECPGst_normal, "fetch in CUR2", ECPGt_EOIT, 
diff --git a/src/interfaces/ecpg/test/expected/sql-fetch.c b/src/interfaces/ecpg/test/expected/sql-fetch.c
index 56781d7..8ffb0ef 100644
--- a/src/interfaces/ecpg/test/expected/sql-fetch.c
+++ b/src/interfaces/ecpg/test/expected/sql-fetch.c
@@ -92,21 +92,21 @@ if (sqlca.sqlwarn[0] == 'W') sqlprint();
 #line 24 "fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 24 "fetch.pgc"
 
 
   /* declare C scroll cursor for select * from My_Table */
 #line 26 "fetch.pgc"
 
 
-  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 1, "C", ECPGst_normal, "declare C scroll cursor for select * from My_Table", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 1, 1, "C", ECPGst_normal, "declare C scroll cursor for select * from My_Table", ECPGt_EOIT, ECPGt_EORT);
 #line 28 "fetch.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
 #line 28 "fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 28 "fetch.pgc"
 
 
   /* exec sql whenever not found  break ; */
@@ -169,21 +169,21 @@ if (sqlca.sqlwarn[0] == 'W') sqlprint();
 #line 42 "fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 42 "fetch.pgc"
 
 
   /* declare D scroll cursor for select * from My_Table where Item1 = $1 */
 #line 44 "fetch.pgc"
 
 
-  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 1, "D", ECPGst_normal, "declare D scroll cursor for select * from My_Table where Item1 = $1", 
+  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_scroll, 1, 1, "D", ECPGst_normal, "declare D scroll 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"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
 #line 46 "fetch.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 46 "fetch.pgc"
 
diff --git a/src/interfaces/ecpg/test/expected/sql-oldexec.c b/src/interfaces/ecpg/test/expected/sql-oldexec.c
index 5ffffa5..7a3790a 100644
--- a/src/interfaces/ecpg/test/expected/sql-oldexec.c
+++ b/src/interfaces/ecpg/test/expected/sql-oldexec.c
@@ -133,21 +133,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 	{ ECPGprepare(__LINE__, NULL, 1, "f", command);
 #line 49 "oldexec.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 49 "oldexec.pgc"
 
 	/* declare CUR no scroll cursor for $1 */
 #line 50 "oldexec.pgc"
 
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 1, 0, ECPGcs_no_scroll, 1, "CUR", ECPGst_normal, "declare CUR no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 1, 0, ECPGcs_no_scroll, 1, 1, "CUR", ECPGst_normal, "declare CUR no scroll 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 "oldexec.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 52 "oldexec.pgc"
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 1, ECPGc_forward, "8", 0, "CUR", 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, 
@@ -192,21 +192,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 	{ ECPGprepare(__LINE__, NULL, 1, "f", command);
 #line 70 "oldexec.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 70 "oldexec.pgc"
 
 	/* declare CUR3 no scroll cursor for $1 */
 #line 71 "oldexec.pgc"
 
 
-	{ ECPGopen(__LINE__, 0, 1, NULL, 1, 0, ECPGcs_no_scroll, 1, "CUR3", ECPGst_normal, "declare CUR3 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 1, 0, ECPGcs_no_scroll, 1, 1, "CUR3", ECPGst_normal, "declare CUR3 no scroll 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"), 
 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
 #line 73 "oldexec.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 73 "oldexec.pgc"
 
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 1, ECPGc_forward, "1", 0, "CUR3", ECPGst_normal, "fetch in CUR3", ECPGt_EOIT, 
diff --git a/src/interfaces/ecpg/test/expected/sql-quote.c b/src/interfaces/ecpg/test/expected/sql-quote.c
index bd44405..0797136 100644
--- a/src/interfaces/ecpg/test/expected/sql-quote.c
+++ b/src/interfaces/ecpg/test/expected/sql-quote.c
@@ -155,21 +155,21 @@ if (sqlca.sqlcode < 0) sqlprint();}
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
 #line 42 "quote.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 42 "quote.pgc"
 
   /* declare C no scroll cursor for select * from \"My_Table\" */
 #line 43 "quote.pgc"
 
 
-  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "C", ECPGst_normal, "declare C no scroll cursor for select * from \"My_Table\"", ECPGt_EOIT, ECPGt_EORT);
+  { ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "C", ECPGst_normal, "declare C no scroll cursor for select * from \"My_Table\"", ECPGt_EOIT, ECPGt_EORT);
 #line 45 "quote.pgc"
 
 if (sqlca.sqlwarn[0] == 'W') sqlprint();
 #line 45 "quote.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
 #line 45 "quote.pgc"
 
 
   /* exec sql whenever not found  break ; */
diff --git a/src/interfaces/ecpg/test/expected/sql-sqlda.c b/src/interfaces/ecpg/test/expected/sql-sqlda.c
index 906b980..f53e401 100644
--- a/src/interfaces/ecpg/test/expected/sql-sqlda.c
+++ b/src/interfaces/ecpg/test/expected/sql-sqlda.c
@@ -244,21 +244,21 @@ if (sqlca.sqlcode < 0) exit (1);}
 if (sqlca.sqlcode < 0) exit (1);}
 #line 97 "sqlda.pgc"
 
 
 	strcpy(msg, "declare");
 	/* declare mycur1 no scroll cursor for $1 */
 #line 100 "sqlda.pgc"
 
 
 	strcpy(msg, "open");
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "mycur1", ECPGst_normal, "declare mycur1 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "mycur1", ECPGst_normal, "declare mycur1 no scroll 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"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 103 "sqlda.pgc"
 
 
 	/* exec sql whenever not found  break ; */
 #line 105 "sqlda.pgc"
@@ -317,21 +317,21 @@ if (sqlca.sqlcode < 0) exit (1);}
 if (sqlca.sqlcode < 0) exit (1);}
 #line 132 "sqlda.pgc"
 
 
 	strcpy(msg, "declare");
 	/* declare mycur2 no scroll cursor for $1 */
 #line 135 "sqlda.pgc"
 
 
 	strcpy(msg, "open");
-	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, "mycur2", ECPGst_normal, "declare mycur2 no scroll cursor for $1", 
+	{ ECPGopen(__LINE__, 0, 1, NULL, 0, 0, ECPGcs_no_scroll, 1, 1, "mycur2", ECPGst_normal, "declare mycur2 no scroll 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"
 
 if (sqlca.sqlcode < 0) exit (1);}
 #line 138 "sqlda.pgc"
 
 
 	strcpy(msg, "fetch");
 	{ ECPGfetch(__LINE__, 0, 1, NULL, 0, ECPGc_forward, "all", 0, "mycur2", ECPGst_normal, "fetch all from mycur2", ECPGt_EOIT, 
