aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test/test4.pgc
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2004-06-28 11:47:42 +0000
committerMichael Meskes <meskes@postgresql.org>2004-06-28 11:47:42 +0000
commite48cfacb8414231db82dc930995492085a260fc7 (patch)
treed2ddf6dff9c06f254d607108ca6d25da6a21305f /src/interfaces/ecpg/test/test4.pgc
parent04ab0cb5c1c0a396aa888187fa45d2ce33ab47b6 (diff)
downloadpostgresql-e48cfacb8414231db82dc930995492085a260fc7.tar.gz
postgresql-e48cfacb8414231db82dc930995492085a260fc7.zip
Arrays can be read as arrays or as character strings now.
Diffstat (limited to 'src/interfaces/ecpg/test/test4.pgc')
-rw-r--r--src/interfaces/ecpg/test/test4.pgc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/test/test4.pgc b/src/interfaces/ecpg/test/test4.pgc
index 10a5fdca1cf..8d58af2817b 100644
--- a/src/interfaces/ecpg/test/test4.pgc
+++ b/src/interfaces/ecpg/test/test4.pgc
@@ -13,7 +13,7 @@ EXEC SQL BEGIN DECLARE SECTION;
int i = 1;
int *did = &i;
int a[10] = {9,8,7,6,5,4,3,2,1,0};
- char text[10] = "klmnopqrst";
+ char text[25] = "klmnopqrst";
char *t = (char *)malloc(10);
double f;
bool b = true;
@@ -64,6 +64,13 @@ EXEC SQL END DECLARE SECTION;
printf("Found text=%10.10s\n", t);
+ EXEC SQL SELECT a
+ INTO :text
+ FROM test
+ WHERE f = :f;
+
+ printf("Found text=%s\n", text);
+
EXEC SQL DROP TABLE test;
EXEC SQL COMMIT;