Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-03

problem with ORACLE

4 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Héctor S. Ponce

I encountered a problem working with ORACLE: data resulting from a SQL not match thrown by the same SQL executed with TOAD. The problem occurs with a calculated field. There is also an error message referring to the metadata.

Oracle version: 10g

CodeTyphon 1.4
Lazarus 0.9.31 Source from SVN 24-01-2011 Rev 29208 (Plus) FreePascal 2.5.1 Source from SVN 24-02-2011 Rev 16995

http://dl.dropbox.com/u/1172938/files.zip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110310/05188ea5/attachment.html>

Reply by email

Joost van der Sluis
to Héctor S. Ponce
H?ctor S. Ponce wrote
I encountered a problem working with ORACLE: data resulting from a SQL not match thrown by the same SQL executed with TOAD. The problem occurs with a calculated field. There is also an error message referring to the metadata.

What is the sql-statment, how is the calculated field defined, what do you expect (ie: what gives TOAD) and what do you get. And finally: (the one thing you should always mention, on every question involving an error-message) what is the exact error message.

Joost.

Reply by email

Hector S. Ponce
to Joost van der Sluis

Sorry, it seems the link http://dl.dropbox.com/u/1172938/files.zip to get all related png files was ommited. The link is still alive and the file can be downloaded.

The problem is as follows:

I have a very simple form with a dbgrid, sqlquery, oracleconnection, datasource, ... the result of execution is shown in dbgrid ...

The SQL.text property of sqlquery is set as:

select c.D10027_TIPO_CONV as tipo,
C.D10027_NRO_SOL as nro,
c.D10027_AMORT as deuda,
c.D10027_CREDITO as credito,
c.D10027_AMORT - c.D10027_CREDITO as dif
from
sigem.d10027 c
where
c.D10027_TIPO_CONV = 80 and
c.D10027_AMORT - c.D10027_CREDITO < 0.1 and
c.D10027_AMORT - c.D10027_CREDITO > 0

when I run the same sql inside TOAD, I get this result:

tipo nro deuda credito dif
80 6043 1.83 0.90 0.93

but from my program the result is

tipo nro deuda credito dif
80 6043 1.83 0.90 (dif field is not retrieved)

if I change SQL in sqlquery to:
...
to_char(c.D10027_AMORT - c.D10027_CREDITO, '0.00') as dif ...
to get "dif" as string, the result is correct, as from TOAD.

If the connection at design time is open when I try to change sql statement in sqlquery, one window error message appears:

"The metadata is not available for this type of database."

The table can by created with this script:

CREATE TABLE SIGEM.D10027
(
D10027_TIPO_CONV NUMBER(2) NOT NULL, D10027_NRO_SOL NUMBER(7) NOT NULL, D10027_NRO_CUOTA NUMBER(3) NOT NULL, D10027_CONCEPTO NUMBER(3) NOT NULL, D10027_CCAJA NUMBER(4),
D10027_F_VTO_AAAA NUMBER(4),
D10027_F_VTO_MM NUMBER(2),
D10027_F_VTO_DD NUMBER(2),
D10027_AMORT NUMBER(9,2),
D10027_INTERES NUMBER(9,2),
D10027_PAGADO NUMBER(9,2),
D10027_F_PAGO_AAAA NUMBER(4),
D10027_F_PAGO_MM NUMBER(2),
D10027_F_PAGO_DD NUMBER(2),
D10027_ESTADO NUMBER(1),
D10027_LEGAL NUMBER(1),
D10027_REFERENCIA NUMBER(7),
D10027_LUGAR_PAGO NUMBER(1),
D10027_RECIBO NUMBER(12),
D10027_PAGO_ADELANTADO NUMBER(5,2),
D10027_CREDITO NUMBER(9,2),
D10027_EXIM NUMBER(5,2),
D10027_IVA_TIPO CHAR(2 BYTE),
D10027_IVA_CUIT CHAR(11 BYTE),
D10027_FACTURADO NUMBER(1),
D10027_FILLER CHAR(7 BYTE)
)

Oracle version: 10g

CodeTyphon 1.4
Lazarus 0.9.31 Source from SVN 24-01-2011 Rev 29208 (Plus) FreePascal 2.5.1 Source from SVN 24-02-2011 Rev 16995

http://dl.dropbox.com/u/1172938/files.zip

El 10/03/2011 01:53 p.m., Joost van der Sluis escribi?:

Show quoted text 13 lines
On Thu, 2011-03-10 at 11:30 -0300, H?ctor S. Ponce wrote: > I encountered a problem working with ORACLE: data resulting from a SQL > not match thrown by the same SQL executed with TOAD. The problem > occurs with a calculated field. There is also an error message > referring to the metadata. What is the sql-statment, how is the calculated field defined, what do you expect (ie: what gives TOAD) and what do you get. And finally: (the one thing you should always mention, on every question involving an error-message) what is the exact error message. Joost.

Reply by email

hector fiandor
to Héctor S. Ponce: I encountered a problem working with ORACLE: data resulting from a SQL not match thrown…

Dear members:

i am using the TDbf component with a pagecontrol and several tabsheets.

i fill the datas in the last tabsheet and quit the app.

next time, when i try to open the app again, show a message talking about invissible or dissable window.

i have added a new tabsheet aftes the last (as a ghost) and then, the problem dont appears.

i wll appreciate any help how to solve this problems.

yours truly,

Ing. H?ctor F. Fiandor Rosario

Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistem a Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas Infomed: http://www.sld.cu/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110311/bfe5c4bf/attachment.html>

Reply by email