diff options
author | Michael Meskes <meskes@postgresql.org> | 2019-02-16 10:55:17 +0100 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2019-02-16 11:05:54 +0100 |
commit | bd7c95f0c1a38becffceb3ea7234d57167f6d4bf (patch) | |
tree | 8ab862d314ec1e241ef0b90fc42edf3f6f5e4be8 /src/interfaces/ecpg/test/expected/sql-oldexec.c | |
parent | 02a6a54ecd6632f974b1b4eebfb2373363431084 (diff) |
Add DECLARE STATEMENT support to ECPG.
DECLARE STATEMENT is a statement that lets users declare an identifier
pointing at a connection. This identifier will be used in other embedded
dynamic SQL statement such as PREPARE, EXECUTE, DECLARE CURSOR and so on.
When connecting to a non-default connection, the AT clause can be used in
a DECLARE STATEMENT once and is no longer needed in every dynamic SQL
statement. This makes ECPG applications easier and more efficient. Moreover,
writing code without designating connection explicitly improves portability.
Authors: Ideriha-san ("Ideriha, Takeshi" <ideriha.takeshi@jp.fujitsu.com>)
Kuroda-san ("Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>)
Discussion: https://postgr.es/m4E72940DA2BF16479384A86D54D0988A565669DF@G01JPEXMBKW04
Diffstat (limited to 'src/interfaces/ecpg/test/expected/sql-oldexec.c')
-rw-r--r-- | src/interfaces/ecpg/test/expected/sql-oldexec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/interfaces/ecpg/test/expected/sql-oldexec.c b/src/interfaces/ecpg/test/expected/sql-oldexec.c index d6a661e3fb5..b98de49f590 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();} |