mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
This one cleans the cursor problems ecpg had so far. It is now able
to understand cursors with variables. Michael
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
all: test1 test2 perftest
|
||||
|
||||
LDFLAGS=-g -I ../include -I ../../libpq -L../lib -lecpg -L../../libpq -lpq -lcrypt --static
|
||||
LDFLAGS=-g -I ../include -I ../../libpq -L../lib -lecpg -L../../libpq -lpq -lcrypt
|
||||
|
||||
test1: test1.c
|
||||
test1.c: test1.pgc
|
||||
|
@ -19,6 +19,10 @@ exec sql begin declare section;
|
||||
long ind_married;
|
||||
char married[9];
|
||||
exec sql end declare section;
|
||||
|
||||
exec sql declare cur cursor for
|
||||
select name, born, age, married from meskes;
|
||||
|
||||
char msg[128], command[128];
|
||||
FILE *dbgs;
|
||||
|
||||
@ -26,7 +30,7 @@ exec sql end declare section;
|
||||
ECPGdebug(1, dbgs);
|
||||
|
||||
strcpy(msg, "connect");
|
||||
exec sql connect to tcp:postgresql://localhost:5432/mm;
|
||||
exec sql connect to tcp:postgresql://localhost:5432/mm;
|
||||
|
||||
strcpy(msg, "create");
|
||||
exec sql create table meskes(name char(8), born integer, age smallint, married char(8));
|
||||
@ -41,10 +45,6 @@ exec sql end declare section;
|
||||
strcpy(msg, "commit");
|
||||
exec sql commit;
|
||||
|
||||
strcpy(msg, "declare");
|
||||
exec sql declare cur cursor for
|
||||
select name, born, age, married from meskes;
|
||||
|
||||
strcpy(msg, "open");
|
||||
exec sql open cur;
|
||||
|
||||
|
Reference in New Issue
Block a user