1#include <stdio.h>
2
3EXEC SQL INCLUDE sqlca;
4exec sql include ../regression;
5
6EXEC SQL WHENEVER SQLERROR sqlprint;
7
8int
9main ()
10{
11  ECPGdebug (1, stderr);
12
13  EXEC SQL CONNECT TO REGRESSDB1;
14  EXEC SQL CREATE TABLE foo (a int, b varchar);
15  EXEC SQL INSERT INTO foo VALUES (5, 'abc');
16  EXEC SQL INSERT INTO foo VALUES (6, 'def');
17  EXEC SQL INSERT INTO foo VALUES (7, 'ghi');
18
19  EXEC SQL COPY foo TO STDOUT WITH DELIMITER ',';
20  printf ("copy to STDOUT : sqlca.sqlcode = %ld\n", sqlca.sqlcode);
21
22  EXEC SQL DISCONNECT;
23
24  return 0;
25}
26