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

*** empty log message ***

This commit is contained in:
Michael Meskes
2000-05-17 06:03:14 +00:00
parent 76da5b80b1
commit e39a118694
6 changed files with 44 additions and 18 deletions

View File

@ -2,7 +2,8 @@ all: test1 test2 test3 test4 perftest dyntest dyntest2
LDFLAGS=-g -I /usr/local/pgsql/include -L/usr/local/pgsql/lib -lecpg -lpq
ECPG=../preproc/ecpg -I../include
ECPG=/usr/local/pgsql/bin/ecpg -I../include
#ECPG=../preproc/ecpg -I../include
.SUFFIXES: .pgc .c
@ -18,4 +19,4 @@ dyntest2: dyntest2.c
$(ECPG) $?
clean:
rm -f test1 test2 test3 test4 perftest *.c *.o log dyntest dyntest2
rm -f test1 test2 test3 test4 perftest *.c log dyntest dyntest2

View File

@ -1,5 +1,3 @@
exec sql include sqlca;
exec sql whenever sqlerror do PrintAndStop(msg);
@ -88,8 +86,9 @@ exec sql end declare section;
strcpy(msg, "commit");
exec sql commit;
/* Stop automatic transactioning for connection pm. */
exec sql at pm set autocommit to off;
/* Start automatic transactioning for connection pm. */
exec sql at pm set autocommit to on;
exec sql at pm begin transaction;
strcpy(msg, "select");
exec sql select name, amount, letter into :name, :amount, :letter from "Test";
@ -117,14 +116,17 @@ exec sql end declare section;
for (i=0, j=sqlca.sqlerrd[2]; i<j; i++)
printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, name[i], i, amount[i],i, letter[i][0]);
strcpy(msg, "drop");
exec sql drop table "Test";
exec sql at pm drop table "Test";
strcpy(msg, "commit");
exec sql commit;
exec sql at pm commit;
/* Start automatic transactioning for connection main. */
exec sql set autocommit to on;
strcpy(msg, "drop");
exec sql drop table "Test";
exec sql at pm drop table "Test";
strcpy(msg, "disconnect");
exec sql disconnect main;
exec sql disconnect pm;

View File

@ -8,7 +8,7 @@ int
main ()
{
EXEC SQL BEGIN DECLARE SECTION;
int i = 3;
int i = 1;
int *did = &i;
int a[10] = {9,8,7,6,5,4,3,2,1,0};
char text[10] = "klmnopqrst";
@ -31,7 +31,7 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL CREATE TABLE test (f float, i int, a int[10], text char(10), b bool);
EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(404.90,1,'{0,1,2,3,4,5,6,7,8,9}','abcdefghij', 'f');
EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(404.90,3,'{0,1,2,3,4,5,6,7,8,9}','abcdefghij', 'f');
EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(140787.0,2,:a,:text,'t');
@ -48,7 +48,7 @@ EXEC SQL END DECLARE SECTION;
printf("Found f=%f text=%10.10s b=%d\n", f, text, b);
f=14.07;
f=140787;
EXEC SQL SELECT a,text
INTO :a,:t
FROM test