1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

ecpg now recognizes named structs/unions. So you don't have to list the whole definition everytime you declare a variable anymore.

This commit is contained in:
Michael Meskes
2003-05-22 07:58:45 +00:00
parent 0b5b3e9e65
commit d03a067ba0
10 changed files with 277 additions and 127 deletions

View File

@ -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");

View File

@ -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";