summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2001-12-08 20:43:35 +0000
committerMichael Meskes <meskes@postgresql.org>2001-12-08 20:43:35 +0000
commitd6fbb105560bc04eaf745a91e802052a23d7c029 (patch)
tree8531403665a1c4dd0de0697d37cec0117e23f52b /src/interfaces/ecpg/test
parent03a321d2143cd1168d10960cada9d688c5140520 (diff)
downloadpostgresql-d6fbb105560bc04eaf745a91e802052a23d7c029.tar.gz
Fix ecpg to allow pointer to structs.
Diffstat (limited to 'src/interfaces/ecpg/test')
-rw-r--r--src/interfaces/ecpg/test/test2.pgc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/test/test2.pgc b/src/interfaces/ecpg/test/test2.pgc
index ec2c790d2b..299250dfa5 100644
--- a/src/interfaces/ecpg/test/test2.pgc
+++ b/src/interfaces/ecpg/test/test2.pgc
@@ -19,10 +19,10 @@ main ()
exec sql begin declare section;
struct personal_struct { str name;
birthinfo birth;
- } personal;
+ } personal, *p;
struct personal_indicator { int ind_name;
birthinfo ind_birth;
- } ind_personal;
+ } ind_personal, *i;
float ind_married;
ind children;
ind ind_children;
@@ -63,9 +63,11 @@ exec sql end declare section;
exec sql whenever not found do break;
+ p=&personal;
+ i=&ind_personal;
while (1) {
strcpy(msg, "fetch");
- exec sql fetch cur into :personal:ind_personal, :married:ind_married, :children.integer:ind_children.smallint;
+ exec sql fetch cur into :p:i, :married:ind_married, :children.integer:ind_children.smallint;
printf("%8.8s", personal.name.arr);
if (ind_personal.ind_birth.born >= 0)
printf(", born %ld", personal.birth.born);
@@ -125,6 +127,5 @@ exec sql end declare section;
if (dbgs != NULL)
fclose(dbgs);
-
return (0);
}