Sujet : Re: VMS x86-64 database server
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 11. Jul 2025, 00:50:05
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <687051ac$0$690$14726298@news.sunsite.dk>
References : 1 2
User-Agent : Mozilla Thunderbird
On 7/6/2025 6:07 PM, Arne Vajhøj wrote:
But there are some incompatibilities between H2 in
PostgreSQL mode and real PostgreSQL.
And one of them is that H2 in PostgreSQL mode
does not support server side cursors.
And embedded SQL without "FETCH cursorname INTO ..."
is like a hotdog without a hotdog sausage!
If one can live with SELECT INTO then everything
is fine (but nobody can).
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
EXEC SQL INCLUDE SQLCA;
int main()
{
EXEC SQL BEGIN DECLARE SECTION;
char f2[51];
long int f1;
char srv[50], un[50], pw[50];
EXEC SQL END DECLARE SECTION;
strcpy(srv, "tcp:postgresql://localhost:5435/test");
strcpy(un, "sa");
strcpy(pw, "hemmeligt");
EXEC SQL CONNECT TO :srv USER :un USING :pw;
f1 = 2;
EXEC SQL SELECT f2 INTO :f2 FROM t1 WHERE f1 = :f1;
printf("%s\n", f2);
return 0;
}
works fine.
Arne