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

Committed again to add the missing files/patches.

This commit is contained in:
Michael Meskes
2001-11-16 08:36:37 +00:00
parent 949af991fc
commit 7845954e49
4 changed files with 225 additions and 193 deletions

View File

@ -0,0 +1,33 @@
#include <stdio.h>
exec sql include sqlca;
#include <stdlib.h>
int main()
{
exec sql begin declare section;
char **cpp=0;
int *ipointer=0;
exec sql end declare section;
int i;
if (getenv("SQLOPT")) ECPGdebug(1,stderr);
exec sql whenever sqlerror do sqlprint();
exec sql connect to template1;
exec sql allocate descriptor mydesc;
exec sql select tablename into descriptor mydesc from pg_tables;
exec sql get descriptor mydesc value 1 :cpp=DATA, :ipointer=INDICATOR;
printf("Result ");
for (i=0;i<sqlca.sqlerrd[2];++i)
{ if (ipointer[i]) printf("NULL, ");
else printf("'%s', ",cpp[i]);
}
ECPGfree_auto_mem();
printf("\n");
exec sql deallocate descriptor mydesc;
exec sql disconnect;
return 0;
}