Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Conexión con bases de datos (https://www.clubdelphi.com/foros/forumdisplay.php?f=2)
-   -   zeos y campo calculado en interbase (https://www.clubdelphi.com/foros/showthread.php?t=18269)

jgutti 07-02-2005 19:31:05

zeos y campo calculado en interbase
 
Hola al foro
delphi 6 + interbase 6 + zeosdbo615stable
- tengo la sgte table en interbase
Create table prueba(codigo integer not null,
nombre varchar(35),
Neto Double precision,
iva computed by (neto * (porc / 100)),
Total Computed by (neto + iva),
primary key(codigo));
- mi problema es el sgte:
- al ejecutar las sgte instrucciones desde delphi
prueba.post;
Prueba.ApplyUpdates;
Prueba.CommitUpdates;
- Emite un error que dice no puede update una columna de solo lectura
- El error se optiene solo si en la tabla utilizo computed by
- como puedo solucionar este problema o tengo que olvidarme de computed by con componentes zeos.

desde ya gracias por la ayuda
atte
jgutti

jgutti 08-02-2005 14:58:10

he solucionado mi problema modificando el archivo ZDbcInterbase6Metadata.pas
- Esta es la solución:
Release 6.1.5 does not support computed source fields. If such a field is used in a table, all INSERT statements generated by ZQuery and ZTable fail due to the attempt at updating a read-only field (ie the field that has a computed source).

I added a preliminary hack to support it, but it is not yet tested thoroughly. It works for me, though. It would be great if your could add this functionality to the 6.5 build.

I made the following changes:
- ZDbcInterbase6Metadata.pas, lines 1703-1710: the SQL SELECT metadata fetch statement has been augmented with another field: Code:
b.RDB$COMPUTED_SOURCE

- ZDbcInterbase6Metadata.pas, line 1788:
the statement Code:
TargetResultSet.UpdateBooleanByName('WRITABLE', True);
was replaced by Code:
TargetResultSet.UpdateBooleanByName('WRITABLE', (TempResultSet.GetStringByName('RDB$COMPUTED_SOURCE') = ''));

atte
jgutti


La franja horaria es GMT +2. Ahora son las 03:19:11.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi