summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2003-05-22 07:58:45 +0000
committerMichael Meskes <meskes@postgresql.org>2003-05-22 07:58:45 +0000
commitd03a067ba030ccc81e71b9291c5bf3476d6d0c12 (patch)
treefea7edb8d38ce640bec02c209547c7cf22653527 /src/interfaces/ecpg/test
parent0b5b3e9e65e65890ba73a3e9c282e136ee42a9d6 (diff)
downloadpostgresql-d03a067ba030ccc81e71b9291c5bf3476d6d0c12.tar.gz
ecpg now recognizes named structs/unions. So you don't have to list the whole definition everytime you declare a variable anymore.
Diffstat (limited to 'src/interfaces/ecpg/test')
-rw-r--r--src/interfaces/ecpg/test/test1.pgc2
-rw-r--r--src/interfaces/ecpg/test/test2.pgc11
2 files changed, 6 insertions, 7 deletions
diff --git a/src/interfaces/ecpg/test/test1.pgc b/src/interfaces/ecpg/test/test1.pgc
index 28c33b4954..f787b8fdb6 100644
--- a/src/interfaces/ecpg/test/test1.pgc
+++ b/src/interfaces/ecpg/test/test1.pgc
@@ -126,7 +126,7 @@ exec sql end declare section;
amount[i]+=1000;
strcpy(msg, "insert");
- exec sql at pm insert into "Test" (name, amount, letter) values (:n, :a, :l);
+ exec sql at pm insert into "Test" (name, amount, letter) values (:n, :a, :l);
}
strcpy(msg, "commit");
diff --git a/src/interfaces/ecpg/test/test2.pgc b/src/interfaces/ecpg/test/test2.pgc
index 28b7c5c0e4..701b11afb5 100644
--- a/src/interfaces/ecpg/test/test2.pgc
+++ b/src/interfaces/ecpg/test/test2.pgc
@@ -9,20 +9,19 @@ typedef char* c;
exec sql type ind is union { int integer; short smallint; };
typedef union { int integer; short smallint; } ind;
-#define BUFSIZ 8
-exec sql type str is varchar[BUFSIZ];
+#define BUFFERSIZ 8
+exec sql type str is varchar[BUFFERSIZ];
int
main ()
{
- typedef struct { long born; short age; } birthinfo;
- exec sql type birthinfo is struct { long born; short age; };
+ exec sql struct birthinfo { long born; short age; };
exec sql begin declare section;
struct personal_struct { str name;
- birthinfo birth;
+ struct birthinfo birth;
} personal, *p;
struct personal_indicator { int ind_name;
- birthinfo ind_birth;
+ struct birthinfo ind_birth;
} ind_personal, *i;
ind ind_children;
c testname="Petra";