exec sql select name, amount, letter into :name, :amount, :letter from "Test";
for (i=0, j=sqlca.sqlerrd[2]; i
printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, name[i], i, amount[i],i, letter[i][0]);
- strcpy(msg, "drop");
- exec sql drop table "Test";
- exec sql at pm drop table "Test";
-
strcpy(msg, "commit");
exec sql commit;
exec sql at pm commit;
+ /* Start automatic transactioning for connection main. */
+ exec sql set autocommit to on;
+
+ strcpy(msg, "drop");
+ exec sql drop table "Test";
+ exec sql at pm drop table "Test";
+
strcpy(msg, "disconnect");
exec sql disconnect main;
exec sql disconnect pm;
main ()
{
EXEC SQL BEGIN DECLARE SECTION;
- int i = 3;
+ int i = 1;
int *did = &i;
int a[10] = {9,8,7,6,5,4,3,2,1,0};
char text[10] = "klmnopqrst";
EXEC SQL CREATE TABLE test (f float, i int, a int[10], text char(10), b bool);
- EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(404.90,1,'{0,1,2,3,4,5,6,7,8,9}','abcdefghij', 'f');
+ EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(404.90,3,'{0,1,2,3,4,5,6,7,8,9}','abcdefghij', 'f');
EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(140787.0,2,:a,:text,'t');
printf("Found f=%f text=%10.10s b=%d\n", f, text, b);
- f=14.07;
+ f=140787;
EXEC SQL SELECT a,text
INTO :a,:t
FROM test