]> granicus.if.org Git - postgresql/commitdiff
*** empty log message ***
authorMichael Meskes <meskes@postgresql.org>
Tue, 2 Nov 1999 19:03:34 +0000 (19:03 +0000)
committerMichael Meskes <meskes@postgresql.org>
Tue, 2 Nov 1999 19:03:34 +0000 (19:03 +0000)
src/interfaces/ecpg/test/test4.pgc [new file with mode: 0644]

diff --git a/src/interfaces/ecpg/test/test4.pgc b/src/interfaces/ecpg/test/test4.pgc
new file mode 100644 (file)
index 0000000..191a747
--- /dev/null
@@ -0,0 +1,44 @@
+exec sql whenever sqlerror sqlprint;
+
+exec sql include sqlca;
+
+int
+main ()
+{
+EXEC SQL BEGIN DECLARE SECTION;
+       int a = 1;
+       double f;
+EXEC SQL END DECLARE SECTION;
+       FILE *dbgs;
+        
+       if ((dbgs = fopen("log", "w")) != NULL)
+                ECPGdebug(1, dbgs);
+
+        EXEC SQL CONNECT TO mm;
+
+       EXEC SQL CREATE TABLE test (f decimal(8,2), a int);
+
+       EXEC SQL INSERT INTO test(f,a) VALUES(17000.00,1);
+
+       EXEC SQL COMMIT;
+
+       EXEC SQL SELECT f::float
+         INTO :f
+         FROM test
+         WHERE a = :a;
+
+       printf("Found f::float=%f\n", f);
+
+       EXEC SQL SELECT f
+         INTO :f
+         FROM test
+         WHERE a = :a;
+
+       printf("Found f=%f\n", f);
+
+       EXEC SQL DROP TABLE test;
+
+       EXEC SQL COMMIT;
+
+       EXEC SQL DISCONNECT;
+}