Always use the same way to addres a descriptor in ecpg's regression tests.

This commit is contained in:
Michael Meskes 2014-01-13 10:41:53 +01:00
parent bb953ad164
commit 976a7d1156
2 changed files with 6 additions and 6 deletions

View File

@ -228,7 +228,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo2", { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo2",
ECPGt_descriptor, "indesc", 1L, 1L, 1L, ECPGt_descriptor, "indesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_descriptor, "outdesc", 1L, 1L, 1L, ECPGt_descriptor, (desc1), 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 53 "desc.pgc" #line 53 "desc.pgc"
@ -236,7 +236,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 53 "desc.pgc" #line 53 "desc.pgc"
{ ECPGget_desc(__LINE__, "outdesc", 1,ECPGd_data, { ECPGget_desc(__LINE__, (desc1), 1,ECPGd_data,
ECPGt_char,(val2output),(long)sizeof("AAA"),(long)1,(sizeof("AAA"))*sizeof(char), ECPGd_EODT); ECPGt_char,(val2output),(long)sizeof("AAA"),(long)1,(sizeof("AAA"))*sizeof(char), ECPGd_EODT);
#line 55 "desc.pgc" #line 55 "desc.pgc"
@ -366,7 +366,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
if (sqlca.sqlcode < 0) sqlprint(); if (sqlca.sqlcode < 0) sqlprint();
#line 85 "desc.pgc" #line 85 "desc.pgc"
ECPGdeallocate_desc(__LINE__, "outdesc"); ECPGdeallocate_desc(__LINE__, (desc1));
#line 86 "desc.pgc" #line 86 "desc.pgc"
if (sqlca.sqlcode < 0) sqlprint(); if (sqlca.sqlcode < 0) sqlprint();

View File

@ -50,9 +50,9 @@ main(void)
EXEC SQL SET DESCRIPTOR indesc VALUE 1 DATA = :val1; EXEC SQL SET DESCRIPTOR indesc VALUE 1 DATA = :val1;
EXEC SQL SET DESCRIPTOR indesc VALUE 2 INDICATOR = :val2i, DATA = :val2; EXEC SQL SET DESCRIPTOR indesc VALUE 2 INDICATOR = :val2i, DATA = :val2;
EXEC SQL EXECUTE foo2 USING SQL DESCRIPTOR indesc INTO SQL DESCRIPTOR outdesc; EXEC SQL EXECUTE foo2 USING SQL DESCRIPTOR indesc INTO SQL DESCRIPTOR :desc1;
EXEC SQL GET DESCRIPTOR outdesc VALUE 1 :val2output = DATA; EXEC SQL GET DESCRIPTOR :desc1 VALUE 1 :val2output = DATA;
printf("output = %s\n", val2output); printf("output = %s\n", val2output);
EXEC SQL DECLARE c1 CURSOR FOR foo2; EXEC SQL DECLARE c1 CURSOR FOR foo2;
@ -83,7 +83,7 @@ main(void)
EXEC SQL DISCONNECT; EXEC SQL DISCONNECT;
EXEC SQL DEALLOCATE DESCRIPTOR indesc; EXEC SQL DEALLOCATE DESCRIPTOR indesc;
EXEC SQL DEALLOCATE DESCRIPTOR outdesc; EXEC SQL DEALLOCATE DESCRIPTOR :desc1;
return 0; return 0;
} }