Oracle Server Questions (FireDAC)

From RAD Studio
Jump to: navigation, search

Go Up to FAQ (FireDAC)

This topic contains a list of questions and answers related to Oracle Server.

Q1: I am looking at putting my application on a PC that already runs an Oracle client so I don't want to use the registry keys. I want to make the path and TNS_Admin variables specific to my application only

A: Just put tnsnames.ora file in the same folder where Oracle Instant Client is located. No need to do something else, like specifying TNS_Admin or TNS_Names. If you do not need to use TNS aliases, then put an empty tnsnames.ora file.

Q2: I am getting the error "Cannot initialize OCI environment" in D2009 application. What is wrong?

A: FireDAC cannot initialize OCI in the Unicode mode that is required for D2009. Most probably, that is due to the old Oracle client version. We suggest to:

  • Upgrade Oracle client software at least to v 9.0;
  • Or stay with a non-Unicode Delphi (<= D2007).

Q3: I need to connect to an Oracle 8.0.5 server. Is that possible?

A: Using the following "roadmap" you can choose the correct Oracle client and Delphi versions:

  • FireDAC with Delphi 2009 or higher requires at least Oracle 8.1.5 client, because starting from Oracle 8.1.5 the client works correctly with Unicode.
  • FireDAC with Delphi 2007 or less requires at least Oracle 8.0.3 client.

Q4: How can I lock a table with Oracle?

A: The generic skeleton for your task may look like:

FDConnection1.StartTransaction;
try
  FDConnection1.ExecSQL('LOCK TABLE ...');
  .........
  FDConnection1.Commit;
except
  FDConnection1.Rollback;
  raise;
end;

Q5: How can I get a list of Oracle services, like FireDAC is doing in Login dialog?

A: Use:

Q6: Is the Oracle Objects extension supported?

A: Not at this moment. As a workaround, you can build PL/SQL wrapping procedures and functions. Using this approach, you can then work with Oracle Advanced Queuing.