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-binary.c | |
parent | 02a6a54ecd6632f974b1b4eebfb2373363431084 (diff) | |
download | postgresql-bd7c95f0c1a38becffceb3ea7234d57167f6d4bf.tar.gz postgresql-bd7c95f0c1a38becffceb3ea7234d57167f6d4bf.zip |
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-binary.c')
-rw-r--r-- | src/interfaces/ecpg/test/expected/sql-binary.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/interfaces/ecpg/test/expected/sql-binary.c b/src/interfaces/ecpg/test/expected/sql-binary.c index 6d92ce344b6..66b1ae884b8 100644 --- a/src/interfaces/ecpg/test/expected/sql-binary.c +++ b/src/interfaces/ecpg/test/expected/sql-binary.c @@ -108,7 +108,7 @@ if (sqlca.sqlcode < 0) exit (1); #line 36 "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 37 "binary.pgc" @@ -116,7 +116,7 @@ if (sqlca.sqlcode < 0) exit (1); if (sqlca.sqlcode < 0) exit (1);} #line 37 "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), @@ -130,7 +130,7 @@ if (sqlca.sqlcode < 0) exit (1);} 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 41 "binary.pgc" if (sqlca.sqlcode < 0) exit (1);} @@ -147,7 +147,7 @@ if (sqlca.sqlcode < 0) exit (1); #line 44 "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 45 "binary.pgc" @@ -155,7 +155,7 @@ if (sqlca.sqlcode < 0) exit (1); if (sqlca.sqlcode < 0) exit (1);} #line 45 "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), @@ -167,7 +167,7 @@ if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);} #line 46 "binary.pgc" - { 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 47 "binary.pgc" if (sqlca.sqlcode < 0) exit (1);} @@ -189,7 +189,7 @@ if (sqlca.sqlcode < 0) exit (1); #line 55 "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 56 "binary.pgc" @@ -197,7 +197,7 @@ if (sqlca.sqlcode < 0) exit (1); if (sqlca.sqlcode < 0) exit (1);} #line 56 "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 57 "binary.pgc" @@ -205,7 +205,7 @@ if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);} #line 57 "binary.pgc" - { 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 58 "binary.pgc" if (sqlca.sqlcode < 0) exit (1);} |