4
EXEC SQL include ../regression;
6
EXEC SQL typedef long mmInteger;
7
EXEC SQL typedef char mmChar;
8
EXEC SQL typedef short mmSmallInt;
10
exec sql type string is char[11];
11
typedef char string[11];
13
exec sql type c is char reference;
16
EXEC SQL BEGIN DECLARE SECTION;
23
EXEC SQL END DECLARE SECTION;
28
EXEC SQL BEGIN DECLARE SECTION;
37
EXEC SQL END DECLARE SECTION;
39
EXEC SQL var vc is varchar[10];
40
ECPGdebug (1, stderr);
43
EXEC SQL connect to REGRESSDB1;
46
printf ("connect error = %ld\n", sqlca.sqlcode);
50
EXEC SQL create table empl
51
(idnum integer, name char(20), accs smallint, string1 char(10), string2 char(10), string3 char(10));
54
printf ("create error = %ld\n", sqlca.sqlcode);
58
EXEC SQL insert into empl values (1, 'user name', 320, 'first str', 'second str', 'third str');
61
printf ("insert error = %ld\n", sqlca.sqlcode);
65
EXEC SQL select idnum, name, accs, string1, string2, string3
66
into :empl, :str, :ptr, :vc
68
where idnum =:empl.idnum;
71
printf ("select error = %ld\n", sqlca.sqlcode);
74
printf ("id=%ld name='%s' accs=%d str='%s' ptr='%s' vc='%10.10s'\n", empl.idnum, empl.name, empl.accs, str, ptr, vc.text);