Oracle8i

Forum related to all other 6.x versions of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

scheurer
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 23.02.2007, 12:52

Oracle8i

Postby scheurer » 23.02.2007, 16:48

We had some experiences with Zeoslib 5.x and Oracle8i. It seems to
be stable and very effizient. So we tried to port some applications from
ACCESS to Oracle8i with Zeoslib6X and the problems began. The
ADO Version had problems with GUID fields the Oracle9i connection
refuses date fields. The 6.6 version is very attractive if somebody
has a patch for the damned date fields. We tracked the problem down
to the following lines


procedure TZOracleResultSet.Open;

....
Status := FPlainDriver.DefineByPos(FStmtHandle, CurrentVar.Define,
FErrorHandle, I, CurrentVar.Data, CurrentVar.Length, CurrentVar.TypeCode,
@CurrentVar.Indicator, nil, nil, OCI_DEFAULT);
CheckOracleError(FPlainDriver, FErrorHandle, Status, lcExecute, FSQL);
---> error when CurrentVar.ColType := stDate;


This behaviour is strang for

we have only the oci.dll from oracle8i in use.
We acces data in a oracle8i server

we verified that every procedure used in zeoslib form oci is loaded
corrrectly besides these 3 procedures:

TOCIDateTimeConstruct
TOCIDateTimeGetTimeZoneOffset
TOCIDateTimeGetTimeZoneName

None of these routines had been called before the error.

The Tdatetime... routines and TOCILob...Temporary routines
omitted in zplainoracle.pas from 6.1.5 load without error

Hope somebody has a workaround or a patch for this.
Migrating to Oracle>8i is not a option (customers).

Sincerely

Karl Scheurer

scheurer
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 23.02.2007, 12:52

Postby scheurer » 26.02.2007, 09:06

In the meantime we solved the datefield problem.
If somebody want to use Zeoslib 6.x with Oracle8 the
following changes are required:

in ZDbcOracleUtils procedure InitializeOracleVar

look for
....

stDate, stTime, stTimestamp:
begin
Variable.TypeCode := SQLT_TIMESTAMP;
Length := SizeOf(POCIDateTime);
end;
...


change to

stDate:
begin
Variable.TypeCode := SQLT_DAT;
Length := 7;
end;
stTime, stTimestamp:
begin
Variable.TypeCode := SQLT_TIMESTAMP;
Length := SizeOf(POCIDateTime);
end;


that's all to make Oracle8i accept Zeoslib

User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Postby mdaems » 26.02.2007, 09:24

Is that compatible with other oracle versions or do you know a way how we can make it compatible?

Mark

marianoel
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 15.11.2007, 18:42
Location: uruguay

Postby marianoel » 16.11.2007, 12:58

Hello, how are you?
I'm new in the forum, excused me for my english....

I live in Salto, (Uruguay, South America) and I am having a problem with Oracle 8 and Zeos, in Date datatypes, so I read something written
by you, where you publish a solution for this kind of problem.

My problem is ZQuery or ZTable on table with date type fields, I
use Oracle 8.05(in a server with Win NT), and in my pc I use
Lazarus 0.9.22 , Zeos 6.6.1 beta, and Win98.
With table within date type I don't have any problem, this is OK.

What you publish was:

=============================================
in ZDbcOracleUtils procedure InitializeOracleVar
look for
....
stDate, stTime, stTimestamp:
begin
Variable.TypeCode := SQLT_TIMESTAMP;
Length := SizeOf(POCIDateTime);
end;
...

change to
stDate:
begin
Variable.TypeCode := SQLT_DAT;
Length := 7;
end;
stTime, stTimestamp:
begin
Variable.TypeCode := SQLT_TIMESTAMP;
Length := SizeOf(POCIDateTime);
end;
=============================================

I made this change, but when I tried to reconstruct Lazarus, I had a
message telling me that there was some kind of compilation problem
(":zdbc6.5.1 failed to compile"). I suppoussed that I had to compile the
package with another tool, so I tried with FreePascal, but it don't see other units, and i get different (lots of) errors.
I want to know what should I do to fix it (compile) and Lazarus keep
working.

I really thank you because It's very difficult to find help in this place
(very few people use these tools)

THANK YOU ,

María Noel.

pol
Senior Boarder
Senior Boarder
Posts: 91
Joined: 13.10.2005, 08:19

Postby pol » 20.11.2007, 10:00

Hi María,

In the end you will have to reconstruct Lazarus to use Zeos with it, so it would be better to look for the compilation errors and what caused them. Did it work before you made these changes?
And Oracle 8.0.5 is really old.

Regards,
Rüdiger

marianoel
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 15.11.2007, 18:42
Location: uruguay

Postby marianoel » 20.11.2007, 21:54

I can reconstruct Lazarus with my changes now, however I have the problem with table with date type fields.
the error is: ORA- 00932 Inconsistent datatype.
The error is with Ztable or Zquery.

I now that Oracle 8.0.5 is old but in the company that I work use it.
Thank you for your interesting but I have the same problem still yet.
Maria Noel

pol
Senior Boarder
Senior Boarder
Posts: 91
Joined: 13.10.2005, 08:19

Postby pol » 21.11.2007, 09:52

Hi Maria,

Is this still with date/time variables? Inserting/updating or also selecting?
Strange enough, the explanation of ORA-00932 sounds quite different:
"An attempt was made to perform an operation on incompatible datatypes. For example, adding a character field to a date field (dates may only be added to numeric fields) or concatenating a character field with a long field. "
Does your query work with sqlplus?
Some suggestions: Use ZSQLmonitor to find out what is going to the database, or turn tracing on in sqlnet.ora.

Regards,
Rüdiger

marianoel
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 15.11.2007, 18:42
Location: uruguay

Postby marianoel » 21.11.2007, 12:17

RÜDIGER, thank you.

the problem is in the select *, I think so.
example:

select *
from resguardo

and the table resguardo is:
ID_DOCUMENTO NUMBER(5),
FECHA_DOCUMENTO DATE,
NRO_COMPROBANTE NUMBER(5)
....
....
In the table moneda with
NRO_MONEDA NUMBER(5),
MONEDA VARCHAR2(15)
I don´t have any problem with select * from moneda.

In Ztable with TableName Resguardo, when I set active = True I've the problem.


Maria Noel

pol
Senior Boarder
Senior Boarder
Posts: 91
Joined: 13.10.2005, 08:19

Postby pol » 22.11.2007, 09:57

Hi Maria,

Do you have persistent fields for table resguardo? That means, have you doubleclicked the component and choosen "add all fields"? Then ZTable1FECHA_DOCUMENTO should be a TDateField. What happens when you are trying it without persistent fields (just deleting them in the field editor)?

Regards,
Rüdiger


Return to “Other 6.x Versions”

Who is online

Users browsing this forum: No registered users and 1 guest