Commit 813d9960 authored by Michael Meskes's avatar Michael Meskes

Forgot these.

parent d258fb91
......@@ -2,7 +2,7 @@
*
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
*
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/test/Attic/dyntest2.pgc,v 1.3 2001/11/14 11:11:49 meskes Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/test/Attic/dyntest2.pgc,v 1.4 2003/05/23 15:22:38 meskes Exp $
*/
#include <stdio.h>
......@@ -72,8 +72,8 @@ exec sql end declare section;
:PRECISION = precision, :SCALE=scale,
:NULLABLE=nullable, :NAME=name,
:INDICATOR=indicator;
printf("%2d\t%s (type: %d length: %d precision: %d scale: %d
\toctet_length: %d returned_octet_length: %d nullable: %d)\n\t= "
printf("%2d\t%s (type: %d length: %d precision: %d scale: %d\n"
"\toctet_length: %d returned_octet_length: %d nullable: %d)\n\t= "
,INDEX,NAME,TYPE,LENGTH,PRECISION,SCALE
,OCTET_LENGTH,RETURNED_OCTET_LENGTH,NULLABLE);
if (INDICATOR==-1) printf("NULL\n");
......
......@@ -126,7 +126,7 @@ exec sql end declare section;
amount[i]+=1000;
strcpy(msg, "insert");
exec sql at pm insert into "Test" (name, amount, letter) values (:n, :a, :l);
exec sql at pm insert into "Test" (name, amount, letter) values (:n, :amount[i], :l);
}
strcpy(msg, "commit");
......@@ -164,9 +164,6 @@ exec sql end declare section;
for (i=0, j=sqlca.sqlerrd[2]; i<j; 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, "select");
exec sql at pm select name, amount, letter into :name_letter from "Test";
strcpy(msg, "commit");
exec sql commit;
......@@ -177,6 +174,16 @@ exec sql end declare section;
for (i=0, j=sqlca.sqlerrd[2]; i<j; i++)
printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, name_letter[i].name, i, name_letter[i].amount,i, name_letter[i].letter);
name_letter[4].amount=1407;
strcpy(msg, "insert");
exec sql insert into "Test" (name, amount, letter) values (:name_letter[4]);
strcpy(msg, "select");
exec sql select name, amount, letter into :name_letter[2] from "Test" where amount = 1407;
printf("Database: mm\n");
printf("name[2]=%8.8s\tamount[2]=%d\tletter[2]=%c\n", name_letter[2].name, name_letter[2].amount, name_letter[2].letter);
/* Start automatic transactioning for connection main. */
exec sql set autocommit to on;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment