From a2c834f709e6841a1eef360f40448167b6f58208 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Tue, 2 Nov 1999 19:03:34 +0000 Subject: [PATCH] *** empty log message *** --- src/interfaces/ecpg/test/test4.pgc | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/interfaces/ecpg/test/test4.pgc diff --git a/src/interfaces/ecpg/test/test4.pgc b/src/interfaces/ecpg/test/test4.pgc new file mode 100644 index 0000000000..191a74789e --- /dev/null +++ b/src/interfaces/ecpg/test/test4.pgc @@ -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; +} -- 2.40.0