Search found 15 matches

by Morelli
Mon 03 May 2021 14:39
Forum: PostgreSQL Data Access Components
Topic: Postgres read/write Array and Objects
Replies: 1
Views: 17626

Postgres read/write Array and Objects

Hi folks,

with ODAC we could access Arrays and Objects like:

TOraObject* sdoGeometry = query->GetObject ("SHAPE");
TOraArray* ordinateInfo = query->GetArray ("GRAPHFORM");
TOraObject* sdoPnt = sdoGeometry->AttrAsObject["SDO_POINT"];

(query is a TOraQuery).

How can we read/write postgres Array and arrays of custom types with pgDac?

Thx for the support

Kind regards,
Michael Morelli
by Morelli
Fri 27 Nov 2020 09:38
Forum: PostgreSQL Data Access Components
Topic: Reading and writing geographic objects
Replies: 27
Views: 90751

Re: Reading and writing geographic objects

Hi,
Had anyone ins this forum successfully read/wrote PostGIS geometries?
by Morelli
Fri 27 Nov 2020 09:25
Forum: PostgreSQL Data Access Components
Topic: PostGIS geometry PgDAC
Replies: 3
Views: 13668

Re: PostGIS geometry PgDAC

Hi,

do you now support PostGIS GEOMETRY?
Had anyone ins this forum successfully read/wrote PostGIS geometries?
by Morelli
Mon 27 Nov 2017 10:18
Forum: Oracle Data Access Components
Topic: Corrupt ClientDataSet content with TOraQuery
Replies: 5
Views: 2337

Re: Corrupt ClientDataSet content with TOraQuery

Perfect, when are you planning to release it officially?
by Morelli
Wed 22 Nov 2017 08:31
Forum: Oracle Data Access Components
Topic: Corrupt ClientDataSet content with TOraQuery
Replies: 5
Views: 2337

Re: Corrupt ClientDataSet content with TOraQuery

Hi, is the bug fixed? When are you going to release the fix?
by Morelli
Fri 06 Oct 2017 11:13
Forum: Oracle Data Access Components
Topic: Corrupt ClientDataSet content with TOraQuery
Replies: 5
Views: 2337

Corrupt ClientDataSet content with TOraQuery

HI Folks,

we just have updated from ODAC Version 10.0.2 to 10.1.3.
In the new Version there is a new bug concerning property 'Fields' of the TOraQuery component.
In Version 10.0.2 the bug did not exist.

We use Embarcadero C++ Builder 10.2 Tokyo on Windows 10.

If we have a TOraQuery-component with the SQL query 'select a, b, c from atable' and then
manually fetch all fields in the fields-property-editor and CHANGE their order like:

Fields:
b
c
a

Then the ClientDataSet which is liked to the TOraProvider (which is liked to the TOraQuery) has a corrupt data-content!!!

Conclusion:
The bug is active if the TOraProvider.Fields do not have the exactly same order/quantity like the SQL-Statement of this component! New in Version 10.1.3.

If you Need a sample Project, I can send you a simple one.

Please fix this bug ASAP because we can not update to Version 10.1.3 because of this bug and had to roll-back to Version 10.0.2.

Another question:
I have observed that the property 'Fields' of the TOraQuery is shown grayed out in the Objectinspector in the IDE. What does this mean? Are they not supported anymore?

Kind regards
Michael Morelli
by Morelli
Tue 12 Apr 2016 12:14
Forum: Oracle Data Access Components
Topic: IdSocketHandle.hpp do not compile due to OraConsts.hpp #define DefaultPort u"1521"
Replies: 3
Views: 1922

IdSocketHandle.hpp do not compile due to OraConsts.hpp #define DefaultPort u"1521"

Hi Folks,
we use C++ Builder 10 Seattle and we updated ODAC from Version 9.5.18 to 9.6.22.
You have added new defines in the OraConsts.hpp file including the define of DefaultPort:

Code: Select all

#define DefaultHost L"localhost"
#define DefaultPort L"1521"
#define DefaultSID L"orcl"
Because of this new define of yours - the files: IdSocketHandle.hpp, IdIOHandlerSocket.hpp and IdCustomTCPServer.hpp (Src: C:\Program Files (x86)\Embarcadero\Studio\17.0\include\windows\rtl) do no more compile successfully!!! The LOC of IdSocketHandle.hpp:

Code: Select all

	__property System::Word DefaultPort = {read=FDefaultPort, write=FDefaultPort, nodefault};

does no more compile because of the OraConsts.hpp define of DefaultPort.

In our Project we have to include both INDY (IdSocketHandle.hpp ect...) and ODAC!

How can we handle this conflict? Is there going to be a new patch of ODAC? How can we fix this Problem?
Thanks for your help!

Kind regards
Michael Morelli
by Morelli
Fri 04 Sep 2015 08:20
Forum: Oracle Data Access Components
Topic: Assertion Failed: TOraObject.Free RefCount = 0
Replies: 6
Views: 1901

Re: Assertion Failed: TOraObject.Free RefCount = 0

Ok thx.

So is this usage correct:

We have a class 'AClass' with a member/field

Code: Select all

TOraObject* Geometry
.
This Object is created by calling

Code: Select all

Geometry = new TOraObject (0);
After creating the object we call N Times:

Code: Select all

Geometry->AllocObject (OracleSession->OCISvcCtx, "MDSYS.SDO_GEOMETRY");
//... do something here
Geometry->FreeObject (true);
Then the 'AClass' calls inside the destructor:

Code: Select all

TOraObject->Release () 
to delete the Geometry Object;

Is there a wrong usage or a Memory leak?
Thanks for your help!
by Morelli
Fri 28 Aug 2015 08:52
Forum: Oracle Data Access Components
Topic: Assertion Failed: TOraObject.Free RefCount = 0
Replies: 6
Views: 1901

Re: Assertion Failed: TOraObject.Free RefCount = 0

Ok, we are looking forward the results/fixes.
by Morelli
Tue 18 Aug 2015 14:14
Forum: Oracle Data Access Components
Topic: Assertion Failed: TOraObject.Free RefCount = 0
Replies: 6
Views: 1901

Assertion Failed: TOraObject.Free RefCount = 0

Hi Folks,
I use C++ XE6 Builder with ODAC 9.5.18.

The following code looks correct but when I delete the query-Object a EAssertion (EAssertion Failed: TOraObject.Free RefCount = 0 (D:\Projects\Delphi\Dac\Common\Source\MemData.pas, Line 8977)) is rised! Why does a delete rise this Assertion!?
Is there something wrong in my code?

Code: Select all

   TOraSession* session = new TOraSession (0);
   session->Server         = "mapsrv11";
   session->Username       = "hkf14t";
   session->Password       = "hkf14t";
   session->Connected      = true;

   TOraQuery* query = new TOraQuery (0);
   query->Session          = session;

   query->SQL->Clear ();
   query->SQL->Add ((String)
         "select * from geof3044 A where " +
         "mdsys.sdo_relate(A.SHAPE, :CUTPOLY," +
         "'mask=ANYINTERACT querytype=WINDOW') = 'TRUE' or A.geofid = 4796");

   query->Params->Clear();
   query->Params->CreateParam (Db::ftObject, "CUTPOLY", Db::ptInput);

   TOraObject* oraObject = new TOraObject (0);
   oraObject->AllocObject (session->OCISvcCtx, "MDSYS.SDO_GEOMETRY");

      // Create Dummy Object
      //
      oraObject->AttrAsInteger["SDO_GTYPE"] = 2003;
      oraObject->AttrAsObject["SDO_POINT"]->IsNull = true;

      TOraArray* elemInfo = oraObject->AttrAsArray["SDO_ELEM_INFO"];
      elemInfo->ItemAsInteger[0] = 1;
      elemInfo->ItemAsInteger[1] = 1003;
      elemInfo->ItemAsInteger[2] = 1;

      TOraArray* ordinates = oraObject->AttrAsArray["SDO_ORDINATES"];
      ordinates->ItemAsFloat[0] = 1;
      ordinates->ItemAsFloat[0] = 1;
      ordinates->ItemAsFloat[1] = 1;
      ordinates->ItemAsFloat[1] = 2;
      ordinates->ItemAsFloat[2] = 2;
      ordinates->ItemAsFloat[2] = 2;
      ordinates->ItemAsFloat[3] = 2;
      ordinates->ItemAsFloat[3] = 1;

   query->ParamByName ("CUTPOLY")->AsObject = oraObject;
   query->Execute ();

   oraObject->FreeObject (true);

   delete oraObject;
   delete query;     // EAssertion Failed: TOraObject.Free RefCount = 0       (D:\Projects\Delphi\Dac\Common\Source\MemData.pas, Line 8977)
   delete session;
Thanks for your help!
Kind regards
Mike
by Morelli
Mon 23 Mar 2015 14:12
Forum: Oracle Data Access Components
Topic: TOraQuery->GetObject ("ObjectName") fails with Invalid Attribute Name Exception
Replies: 3
Views: 1233

Re: TOraQuery->GetObject ("ObjectName") fails with Invalid Attribute Name Exception

Is there a known issue concerning this Problem - is there a Workaround?
Or are there newer techniques to get an Object from a TOraQuery?

Thanks for your help!
by Morelli
Mon 23 Mar 2015 14:08
Forum: Oracle Data Access Components
Topic: Create/Delete a TOraObject in C++
Replies: 3
Views: 1302

Re: Create/Delete a TOraObject in C++

Hi,

What "Create" and "Free" Method do you mean? These functions do not exist in C++!
Do you mean CreateObject and FreeObject?

In your ODAC-Help there is a note (TOraObject.CreateObject Method):
Note: This method is obsolete, so it's better to use the AllocObject method instead.
And you say:
After calling the Create method, you should also call the AllocObject method
So what is correct now? Please explain ;)

And what I really not understand is why do I have to call c++ new and AllocObject?
by Morelli
Thu 19 Mar 2015 16:32
Forum: Oracle Data Access Components
Topic: Create/Delete a TOraObject in C++
Replies: 3
Views: 1302

Create/Delete a TOraObject in C++

Hi Folks,

I'm using C++ and not Delphi.
And i get a bit confused about what is the correct manner to create and destroy a TOraObject for example.

If I create an TOraObject with new. I get a pointer to a object-instance.
But do I have to call TOraObject->AllocObject (...) too? If yes, why?

And do I have to call TOraObject->FreeObject() or just delete?

So far I used to do it like this:

Code: Select all

TOraObject* sdoGeometry = new TOraObject (0);
sdoGeometry->AllocObject (query->Session->OCISvcCtx, "MDSYS.SDO_GEOMETRY");
...
sdoGeometry->FreeObject (true);
delete sdoGeometry;
Is this correct in C++?

Thanks for your help!
by Morelli
Thu 19 Mar 2015 16:11
Forum: Oracle Data Access Components
Topic: TOraQuery->GetObject ("ObjectName") fails with Invalid Attribute Name Exception
Replies: 3
Views: 1233

TOraQuery->GetObject ("ObjectName") fails with Invalid Attribute Name Exception

Hi Folks,

we have migrated our Project from XE to XE6 C++ Builder and updated to the ODAC Version 9.4.12.

Since this migration (without any code-changes) we get the Problem that the following code throws sometimes a "Invalid Attribute Name"-Exception:

Code: Select all

TOraObject* sdoGeometry = TOraQuery->GetObject ("SHAPE");
MSdoGeomType sdoGtype = sdoGeometry->AttrAsInteger["SDO_GTYPE"]; //Exception here
Randomly this code throws or works! Some times it works, and some times not!
The Problem seems to be the first LOC, due the TOraObject is not correctly getted!

The TOraQuery is properly initialized and ObjectView = true.

Is there a known issue concerning this Problem - is there a Workaround?
Or are there newer techniques to get an Object from a TOraQuery?

Thanks for your help!