1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

+ Sat Feb 21 19:10:55 CET 1998

+
+       - use char[] as string not as array of bytes that is integers
+
+ Sun Feb 22 16:37:36 CET 1998
+
+       - use long for all size variables
+       - added execute immediate statement
+
+ Sun Feb 22 20:41:32 CET 1998
+
+       - use varcharsize = 1 for all simple types, 0 means pointer, > 1
+         means array if type is char resp. unsigned char
+
+ Thu Feb 24 12:26:12 CET 1998
+
+       - allow 'go to' in whenever statement as well as 'goto'
+       - new argument 'stop' for whenever statement

From: Michael Meskes <meskes@topsystem.de>
This commit is contained in:
Marc G. Fournier
1998-02-24 15:52:13 +00:00
parent 0227a4e114
commit 80e12829cf
10 changed files with 247 additions and 105 deletions

View File

@ -34,6 +34,16 @@ exec sql end declare section;
strcpy(msg, "connect");
exec sql connect 'mm';
strcpy(msg, "create");
exec sql create table meskes(name char8, born int4, age int2);
strcpy(msg, "insert");
exec sql insert into meskes(name, born, age) values ('Petra', 19661202, 31);
exec sql insert into meskes(name, born, age) values ('Michael', 19660117, 32);
exec sql insert into meskes(name, born, age) values ('Carsten', 19910103, 7);
exec sql insert into meskes(name, born, age) values ('Marc', 19930907, 4);
exec sql insert into meskes(name, born, age) values ('Chris', 19970923, 0);
strcpy(msg, "declare");
exec sql declare cur cursor for
select name, born, age from meskes;
@ -41,14 +51,23 @@ exec sql end declare section;
exec sql open cur;
while (1) {
/* make sure we leave this loop */
exec sql whenever not found break;
strcpy(msg, "fetch");
exec sql fetch in cur into :personal;
printf ("%8.8s was born %d (age = %d)\n", personal.name.arr, personal.birth.born, personal.birth.age);
}
/* back to normal behaviour */
exec sql whenever not found sqlprint;
strcpy(msg, "close");
exec sql close cur;
strcpy(msg, "drop");
exec sql drop table meskes;
strcpy(msg, "commit");
exec sql commit;