1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

- Made sure Informix style decimal vars are initialized. They use a

fixed amount of digits and not an allocated one. So we have to work
  around. PostgreSQL numeric type remains the same.
- In INFORMIX_SE mode with autcommit set, make all cursors be "with
  hold". Is this really they way SE behaves?
This commit is contained in:
Michael Meskes
2003-06-29 16:52:58 +00:00
parent 4355d4fb21
commit cf883ea95c
5 changed files with 41 additions and 11 deletions

View File

@ -8,7 +8,7 @@ main()
char *text="error\n";
Numeric *value1, *value2, *res;
exec sql begin declare section;
decimal(14,7) des = {0, 0, 0, 0, 0, NULL, NULL} ;
numeric(14,7) des = {0, 0, 0, 0, 0, NULL, NULL} ;
exec sql end declare section;
double d;
FILE *dbgs;

View File

@ -5,7 +5,7 @@ void openit(void);
int main()
{
$int i = 14;
$int j;
$decimal j;
FILE *dbgs;
if ((dbgs = fopen("log", "w")) != NULL)
@ -15,24 +15,30 @@ int main()
$create table test(i int primary key, j int);
rsetnull(CINTTYPE, (char *)&j);
rsetnull(CDECIMALTYPE, (char *)&j);
$insert into test (i, j) values (7, :j);
$insert into test (i, j) values (:i, 1);
$declare c cursor for select * from test where i <= :i;
openit();
j=0;
deccvint(0, &j);
while (1)
{
$fetch in c into :i, :j;
if (sqlca.sqlcode == 100) break;
else if (sqlca.sqlcode != 0) printf ("Error: %ld\n", sqlca.sqlcode);
if (risnull(CINTTYPE, (char *)&j))
if (risnull(CDECIMALTYPE, (char *)&j))
printf("%d\n", i);
else
printf("%d %d\n", i, j);
{
int a;
dectoint(&j, &a);
printf("%d %d\n", i, a);
}
}
$delete from test where i=87;