1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Re-enabled variables in fetch/move command.

This commit is contained in:
Michael Meskes
2008-01-15 10:31:47 +00:00
parent abab776b3c
commit dbdc2e52a0
8 changed files with 127 additions and 157 deletions

View File

@ -26,13 +26,13 @@
int main(int argc, char* argv[]) {
/* exec sql begin declare section */
#line 9 "fetch.pgc"
char str [ 25 ] ;
#line 10 "fetch.pgc"
int i ;
int i , count = 1 ;
/* exec sql end declare section */
#line 11 "fetch.pgc"
@ -146,7 +146,9 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 37 "fetch.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in C", ECPGt_EOIT,
{ ECPGdo(__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),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(str),(long)25,(long)1,(25)*sizeof(char),

View File

@ -7,7 +7,7 @@ EXEC SQL INCLUDE ../regression;
int main(int argc, char* argv[]) {
EXEC SQL BEGIN DECLARE SECTION;
char str[25];
int i;
int i, count=1;
EXEC SQL END DECLARE SECTION;
ECPGdebug(1, stderr);
@ -36,7 +36,7 @@ int main(int argc, char* argv[]) {
EXEC SQL WHENEVER NOT FOUND CONTINUE;
EXEC SQL MOVE BACKWARD 2 IN C;
EXEC SQL FETCH 1 IN C INTO :i, :str;
EXEC SQL FETCH :count IN C INTO :i, :str;
printf("%d: %s\n", i, str);
EXEC SQL CLOSE C;