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