[Solved] Problem using TOraQuery with BDS 2009 and Oracle 8

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
siapf_fp
Posts: 6
Joined: Mon 22 Feb 2010 09:46
Location: Bordeaux, France

[Solved] Problem using TOraQuery with BDS 2009 and Oracle 8

Post by siapf_fp » Mon 22 Feb 2010 10:17

Hi,

I am currently working on a little test app in Delphi 2009 with ODAC 6.90 (more precisely, version 6.90.0.55 for RAD Studio 2009) connecting to Oracle 8.
The OraTools Add-In (version 2.65.1.22) are installed too.

This little app is made of a simple form holding a TDBGrid component, a TDataSource one, a TOraSession and a TOraQuery.
There is no processing code associated to this, as I said it is just a little test to show some data in a grid.
The SQL statement used is something along :

SELECT field1, field2, field3, field4 FROM table;


The project builds fine and the application shows the data correctly; the issue I am currently facing is that the component does not seem to be able to get the table fields from the database in design mode.
The Designer, the Builder and the Data Editor are working fine.


Thank you for your answer
Last edited by siapf_fp on Wed 24 Feb 2010 12:11, edited 1 time in total.

siapf_fp
Posts: 6
Joined: Mon 22 Feb 2010 09:46
Location: Bordeaux, France

Post by siapf_fp » Tue 23 Feb 2010 18:26

I figured that the information I gave you was a little lean, especially about Oracle, so here it is, as shown in the TOraSession info tab (client mode there) :

OCI: Version 8.0.5.0.1
DLL: C:\orant\BIN\oci.dll
Home [DEFAULT_HOME]: C:\orant
Current Home: C:\orant
Call style: v8
Oracle: Oracle8 Enterprise Edition 8.0.5.0.0

It is the same call for the Oracle version in Direct mode.

I performed a bit of further testing, and did not find anything significant so far. While in design mode the connection process does work, whether in direct or in client mode, and so does the test application. As a side note, it seems that oci.dll is not reloaded when going from client mode to direct mode, and then back to client mode... I may be missing my point there; if so, I hope you won't mind.

Coming back to the main subject , I forgot to mention that in the OraQuery Editor all the checkboxes and the radiobuttons are disabled in the SQL Generator tab, even after Execut(e)ing the SQL statement. Putting a fieldname in the KeyFields property and going back to the OraQuery Editor does enable the radiobuttons, and the "Check", "Lock", "Use RETURNING", "Quote names", "Use refresh" and "All fields" checkboxes after using the "Get Fields" button. The "Generate SQL" button becomes also available by then, and still does not seem to trigger any update to the "Update Fields" column. But there is an SQL statement generated for each of "Delete" and "Lock" checkboxes, provided that they are checked.

I hope this will give you some insight on what is happening.

Thank you in advance for the advice you could give to me.

siapf_fp
Posts: 6
Joined: Mon 22 Feb 2010 09:46
Location: Bordeaux, France

Solution to the design time problem

Post by siapf_fp » Wed 24 Feb 2010 12:08

Hello,

I finally found the solution to the problem : It was not the TOraQuery component that was the culprit, but rather the TOraSession one.

Quoting from the TOraSession Class page in the user manual :

[quote] After setting the Username, Password and Server properties, you can establish a connection to the database by calling the Connect method or setting the Connected property to True. [/quote]

And so did I set up the component. But in order to fetch the fields I had to put the database schema name I was working on in the property of the same name. Then, everything went back to normal.

So I guess this issue is closed.

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Wed 24 Feb 2010 12:19

I don't fully undestand the problem problem you are experiencing. Were you able to connect in Design Time? Was the Updated Columns combobox still empty after you clicked the Get Fields button?

siapf_fp
Posts: 6
Joined: Mon 22 Feb 2010 09:46
Location: Bordeaux, France

Post by siapf_fp » Wed 24 Feb 2010 14:04

Hi,

thank you for your answer. I was wondering if I was clear enough with my explanations...

I was able to connect in Design time from the TOraQuery component during the whole issue. The problem I was reporting was that clicking the "Get Fields" button did neither fill the comboboxes nor enable the "Generate SQL" button or the checkboxes.

After some further research I found that putting the name of the database schema I was working on in the Schema property of the TOraSession component, clicking the "Get Fields" button does indeed give the results I was striving for:
the "Update Fields" and "Key Fields" comboboxes are no longer empty, the checkboxes get enabled and the "Generate SQL" button does generate the selected SQL statements. That is what I was refering to by saying that everything went back to a normal state.

As a reminder of what I was working on a form (TForm) with the following components on it:

- A TOraSession
- A TOraQuery
- A TDataSource
- A TDBGrid

No processing was made in the application, least for the Form.Create() method that call OraSession.Connect and OraQuery.Open.
The following TOraSession properties were set in the Object Insepctor :

- Server
- Username
- Password
- LoginPrompt (set to False)

Building from the Release profile or the Debug profile did not matter.


I hope I was a bit clearer. Feel free to ask for more details if you feel the need to, or to edit this thread if you wish to make it more readable.

Best regards,

Francis.

Post Reply