Interbase and IBX F.A.Q. and Tutorials Interbase / IBX F.A.Q.
  InterBase & IBX help
 

Frequently Asked Questions

 

New to Interbase and IBX? Here you'll find answers to common questions posted in the borland.public.delphi.database.interbaseexpress and borland.public.interbase.general forums.

Find the job you want. HotJobs.com

InterBase Express FAQ
Where can I download latest version of IBX?

Always from CodeCentral.

Top
How does Refresh work in IBX?

Contrary to BDE's behavior, the Refresh method in IBX refreshes only the current record (where the dataset cursor is positionated) in order to minimize network traffic. If you want to refresh more than one record, close and re-open the dataset.

Top

How does RecordCount work in IBX?

Recordcount returns the number of fetched records. Because IBX only fetches new records when something actually asks for the next record, after opening a dataset RecordCount will return 0 if the dataset is empty and 1 if it is not. After a FetchAll (not an advisable practice), RecordCount will return the total number of records in the dataset.

In IBX, RecordCount should never be used to rely on how many records exist since it is only reliable for Paradox and DBase. If you really need to know the number of records in a dataset, issuing a "SELECT COUNT(*)" in a separate TIBSQL does the trick in most cases without the overhead of a FetchAll.

Top

When connecting a DBLookUpComboBox to a TIBQuery, I see just one record in the drop down list. Why?

Again, IBX only fetches records when something actually asks for the next record. In the case of the DBLookupCombo, it is incorrectly relying on the RecordCount (see previous question) to scale the drop down area before trying to fill the drop down list.

To solve it, just do the following in the combo's AfterOpen event (to force the fetching of at least a handful of records; this will increase the value of RecordCount):

With (Sender as TDataset) do begin
       MoveBy(MyDBLookupCombo.DropDownCount);
      First;
end;
Top
Why should I avoid using TIBTable?

Short answer: TIBTable is not C/S friendly, it is included in IBX for compatibility reasons only. TIBDataSet is the direct replacement.

Not-so-short answer: The Table Paradigm comes from file based databases like Paradox.  Basically no matter where the table is located all the rows and all the columns (and usually all the index information) is brought locally so the SQL engine (like the BDE) can work
with the data.  Since all the data must be retrieved locally anyways the TTable
was designed to work better in that environment.

The C/S Paradigm says that you let the server do the work of selecting what data
you need and you return only that which the user needs.  IOW you may only return
3 of the 5 columns or only 100 of the 1,000,000 rows etc.  The Table paradigm
tends to flood the network and does not scale well at all in the C/S world.

TIBDataset you just fill out the SelectSQL for what data needs to be retrieved
and the right click on it and select the DataSet Editor to let it help you
determine the InsertSQL, ModifySQL, DeleteSQL and RefreshSQL.  Once those are
filled out you have a fully updatable result set.  And it will be less expensive
in terms of speed, network traffic and memory than a table based paradigm.

Top
I can't see updates made by other users. Why?

First, check if your transaction isolation mode is Read Committed. If it's Snapshot (the Interbase default), you'll always get a consistent view of the data -- i.e., you won't see changes made by other users. Hint: To change the transaction isolation mode to Read Committed, double-click on your TIBTransaction component.

Next, make sure your application actually commits a transaction after any updates, either by using CommitRetaining or Commit.

Finally, if your dataset is already open on your PC when another user performs some updates, you will see those changes only after you close and re-open the dataset, or after you call the Refresh method and the updated record is the current record you are viewing.

Top
Why do my datasets close when I call Commit or Rollback?

Short answer: That's normal IBX behavior. Use CommitRetaining or RollbackRetaining to keep your datasets open.

Not-so-short-answer: In IBX, if you call Commit or Rollback this brings to an end the existence of a transaction handle on the client. As a result, all things that depend upon that transaction need to be rectified or they will become invalid. Without a transaction, InterBase doesn't know which versions of the records you should see -- i.e., it doesn't know whether your isolation mode should be ReadCommitted or Snapshot.

There are essentially two things that depend on a transaction. 1) Any changes that have been posted to the server and 2) any currently open "cursors".

A cursor in InterBase is what you get after executing a select statement with multiple records to return. You interact with the cursor by requesting fetches until that cursor is exhausted. All open cursors are dependant upon a transaction handle being present and if that transaction is ended the cursor will become invalid.

So, what IBX does when you call Commit or Rollback is to close all of your open datasets in order to avoid getting an invalid cursor error. This is because with IBX there isn't a layer that provides isolation between having datasets opened and ending transactions as the BDE and IBO do.

If you want to keep your datasets open, it is recommended that you use CommitRetaining or RollbackRetaining for processing your logical units of work (changes) to avoid datasets closing and that you reserve the usage of Commit and Rollback for when you want to free up the server so it can do its garbage collection, etc. You should do a "hard" Commit or Rollback as frequently as possible, though.

Top
When using Cached Updates with a Master/Detail relation, details disappear when I post. What gives?

This behavior is up at the TDataset level. When you go into Edit mode (or when
you ApplyUpdates) the DataLink is passed a message that the cursor has been
repositioned. This message will cause detail queries to close and re-open on the
"new" position. The only way to stop this is to break the DataLink. Set the detail's DataSource to nil before applying the master's update.

Top

InterBase FAQ
Where can I download latest InterBase release?

Currently there are two companies that provide InterBase Open Source releases, namely Borland and IBPhoenix.

Top
Is InterBase free or do I have to buy any licenses?

It depends on the product and the company you select.

  • InterBase, from Borland
    Borland is currently releasing two "flavors" of InterBase.

    The Open Source version is absolutely free for commercial development and deployment, but Borland does not provide support for it.

    The Certified version is a commercial product, it does require paid licenses for the server and the clients but includes additional features not found in the Open Sourced product, like the replication engine, the ODBC driver, etc.

    Borland has posted a Response to Recent Inquiries document, with questions and answers  regarding the differences between the two InterBase versions.

  • Firebird, from IBPhoenix
    Firebird is an Open Source project based on the original InterBase source code released by Borland. Firebird is a now a stable, free InterBase, as it does not require any licenses.

    IBPhoenix
    is the organization behind Firebird. IbPhoenix provides new releases of Firebird and commercial support options for both Firebird and InterBase.
Top
What is the proper procedure for installing InterBase?

You'll find the following install info sites useful:

For Linux/Unix:

For Windows:

Top
What is the difference between InterBase Classic Server and Super Server for Linux?

Read this article from Borland. In addition to this, note that Classic supports SMP, while SuperServer presently does not.  However, this will change in the not-so-distant
future.

Top
How do I set up InterBase to start automatically in Linux?

Classic Server:
Classic is usually invoked by inetd or xinetd automatically, no need to do anything.

Super Server:
Use a script. At the InterBase2000.org site you'll find the ibserver script I use.
Once the server is running, you can stop it with "/etc/rc.d/init.d/ibserver stop" and restart it with "/etc/rc.d/init.d/ibserver sart". 

Top
Where do I get the documentation?

Get the InterBase 6.0 Documentation Set (10.04 mb, PDF) from the Interbase Documentation page. Despite the "Beta" condition, it is quite comprehensive and well worth downloading.
According to Borland, the final revision of the docs should be released soon.

Top
IBConsole can't connect to my InterBase Classic Server in Linux.

Usually you get the following error:

Cannot attach to services manager.
Services functionality will be supported in a later version of the product.

This is because the Services API (used by IBConsole) is only supported in SuperServer
architecture.  You can't use it with Classic architecture. Try a different InterBase administration tool from the Contributed Downloads at IBPhoenix.

Top
What are the default user and password for InterBase?

Username = SYSDBA, Password = masterkey.  Change the (case-sensitive) password is the first thing to do after installation.

Top
Is it possible to use BDE with dialect 3 new features?

If you're using SQL Links, no. The current SQL Links driver for InterBase 6 does not support Dialect 3. You *can* connect to a IB6 Dialect 1 database, though.

For now you might use the BDE with an ODBC driver that knows dialect 3, or wait for a new SQL Links driver, which should be released at the same time as Delphi 6.

Top
Is there an ODBC driver for InterBase 6?

As a matter of fact, there are several. Check out the list of interface components from IBPhoenix and the Packages and Utilities list from Claudio Valderrama.

A popular choice is the ODBC driver from EasySoft. It will be included with the certified release of InterBase 6 from Borland.

Top
Does InterBase support the LIMIT / TOP predicate in a Select?

InterBase does not support the non-ANSI Standard LIMIT / TOP syntax. You can write a Stored Procedure that is selectable and exits after the passed value of iterations.

You'll have to modify the following example slightly, but it should get you on the right track:

Top

InterBase does not have a native Boolean data type. How can I create one myself?
  • Declare a field of type CHAR and use CHECK CONSTRAINTS to limit the values that are allowed to be entered into it.

    Example:

    CHAR(1) CHECK (VALUE IN ("Y", "N")) NOT NULL;

  • Similar to above but use a domain to create a global data type for the database so that you may reuse the data type more easily.

    Example:

    CREATE DOMAIN YESNO AS CHAR(1) CHECK (VALUE IN ("Y","N")) NOT NULL;
Top
How do I start using User Defined Functions (UDF) in InterBase?

InterBase 6 comes with a ready-to-use library of user defined functions. UDFs are included in <Interbase>\UDF\ib_udf.dll in the Windows version and in /opt/interbase/UDF/ib_udf in Linux/Unix. This functions must be declared on all databases where you want to use them; declarations are included in the ib_udf.sql script in both versions. 

Here's what to do for Linux/Unix systems:

  • Change to the InterBase bin directory:
    cd /opt/interbase/bin
  • Using the isql utility, execute the ib_udf.sql script on your database:
    ./isql /path/to/yourdb/yourdb.gdb -i /opt/interbase/examples/ib_udf.sql

For Windows systems:

  • Connect to your database using IBConsole or your IB administration tool.
  • Execute the ib_udf.sql script located in <InterBase>\examples\udf.

UDFs should now be ready to use in yourdb.gdb database. If you plan to write your own functions, refer to the following tutorial:

Top
What if my question isn't on this list?

Don't panic :-) You can search millions of InterBase / IBX news post on this sites:

No luck yet? Post your question to the forums listed at the top of this document, or to the appropriate forum hosted by Borland.

Please note that according to the newsgroup guidelines, you should not crosspost or multipost your message. Please post your message to the single most appropriate group. 

Top


About this FAQ

This document is compiled and maintained by Jorge Alvarez from sunny Nuevo Laredo, México. Contributions, corrections, and comments are welcome and encouraged.

Top

 
 
 
  Add Me!