diff options
| author | Michael Meskes <meskes@postgresql.org> | 2003-05-29 13:59:26 +0000 |
|---|---|---|
| committer | Michael Meskes <meskes@postgresql.org> | 2003-05-29 13:59:26 +0000 |
| commit | 196d0dd10bbe1778eacbea229904f6744bd9c2fb (patch) | |
| tree | b2b1e2f4e735fbcecb515119bbcf4104a11c96ae /src/interfaces/ecpg/test | |
| parent | bbe990222365aa4a8dfdf2b203ea185b92df6a1c (diff) | |
| download | postgresql-196d0dd10bbe1778eacbea229904f6744bd9c2fb.tar.gz | |
Changed variable parsing so struct[n].attr works.
Diffstat (limited to 'src/interfaces/ecpg/test')
| -rw-r--r-- | src/interfaces/ecpg/test/num_test.pgc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/interfaces/ecpg/test/num_test.pgc b/src/interfaces/ecpg/test/num_test.pgc index 42eb66d9a0..4e921bb33e 100644 --- a/src/interfaces/ecpg/test/num_test.pgc +++ b/src/interfaces/ecpg/test/num_test.pgc @@ -21,37 +21,37 @@ main() exec sql create table test (text char(5), num decimal(14,7)); value1 = PGTYPESnew(); - PGTYPESnumeric_iton(1407, value1); - text = PGTYPESnumeric_ntoa(value1); + PGTYPESnumeric_from_int(1407, value1); + text = PGTYPESnumeric_to_asc(value1, 0); printf("long = %s\n", text); - value1 = PGTYPESnumeric_aton("2369.7", NULL); - value2 = PGTYPESnumeric_aton("10.0", NULL); + value1 = PGTYPESnumeric_from_asc("2369.7", NULL); + value2 = PGTYPESnumeric_from_asc("10.0", NULL); res = PGTYPESnew(); - decadd(value1, value2, res); - text = PGTYPESnumeric_ntoa(res); + PGTYPESnumeric_add(value1, value2, res); + text = PGTYPESnumeric_to_asc(res, 0); printf("add = %s\n", text); PGTYPESnumeric_sub(res, value2, res); - text = PGTYPESnumeric_ntoa(res); + text = PGTYPESnumeric_to_asc(res, 0); printf("sub = %s\n", text); PGTYPESnumeric_copy(res, &des); exec sql insert into test (text, num) values ('test', :des); - value2 = PGTYPESnumeric_aton("2369.7", NULL); + value2 = PGTYPESnumeric_from_asc("2369.7", NULL); PGTYPESnumeric_mul(value1, value2, res); exec sql select num into :des from test where text = 'test'; PGTYPESnumeric_mul(res, &des, res); - text = PGTYPESnumeric_ntoa(res); + text = PGTYPESnumeric_to_asc(res, 0); printf("mul = %s\n", text); - value2 = PGTYPESnumeric_aton("10000", NULL); + value2 = PGTYPESnumeric_from_asc("10000", NULL); PGTYPESnumeric_div(res, value2, res); - text = PGTYPESnumeric_ntoa(res); - PGTYPESnumeric_ntod(res, &d); + text = PGTYPESnumeric_to_asc(res, 0); + PGTYPESnumeric_to_double(res, &d); printf("div = %s %e\n", text, d); exec sql rollback; |
