Académique Documents
Professionnel Documents
Culture Documents
Exporting an internal table to a text named this file “C:\NL_EXT.TXT”. STEP V. Exporting to an
file requires that a ‘newline’ column Now the text file must be associated external file
contain a carriage return. You could with the database. The following
The final step is to issue a simple
use a C/Delphi UDF to pass the ASCII CREATE statement will add the
INSERT statement to move the data
character value (as a string) to the appropriate information to the data-
from the internal table to the external
UPDATE statement, but there is a base’s system tables for later access:
file:
way using standard SQL.
CREATE TABLE NL_EXT EXTERNAL
FILE “C:\NL_EXT.TXT” insert into T1_EXT (ID, name,
STEP I. Add a Newline Column (NEWLINE CHAR(2)); newline)
select CAST(ID as char(4)),
Assume that the table you wish to STEP IV. Inserting a cast(NAME as char(10)),
export (TABLE1) has two fields (ID NEWLINE from TABLE1
carriage return
INTEGER, NAME VARCHAR(10)) and Note that the ID column in T1_EXT
some existing data: First, take a look at what table
was a CHAR and you had to use the
TABLE1 consists of:
ID NAME CAST operator to move the numeric
==== ========== select * from TABLE1 value to the external file. You also
101 Name1
102 Name2
had to use the CAST operator with
ID NAME NEWLINE
103 Name3 ==== ====== ======= the NAME column for a similar
101 name1 <null> reason: InterBase requires that
The first step is to add a column to 102 name2 <null>
columns in an external file to be of a
103 name3 <null>
hold a NEWLINE character: fixed length.
ALTER TABLE TABLE1 ADD NEWLINE Then you issue the following SQL And now to see how the data went
CHAR(2); statement that takes the carriage over?
return value in the newline external
STEP II. Create a select * from T1_EXT
file (NL_EXT) and updates the NULL
Destination Table
newline column in the internal table ID NAME NEWLINE
(TABLE1) with it. ==== ====== =======
The next step is to create an external 101 name1
table that will hold the final exported 102 name2
update TABLE1 set newline = 103 name3
data. The fields must correspond to (select newline from NL_EXT)
those of the table to be exported James Arias-La Rheir is a Technical
(including the newly added NEWLINE Now TABLE1 has: Support Engineer at InterBase Software
field), be of type CHAR and wide Corporation.
select * from TABLE1
enough to hold the the existing data:
ID NAME NEWLINE
CREATE TABLE T1_EXT EXTERNAL ==== ====== =======
Interested in contributing to future
FILE “C:\T1_EXT.TXT” 101 name1 InterCom issues?
(ID CHAR(3), NAME CHAR(10), 102 name2 Have a suggestion for an article
NEWLINE CHAR(2)); 103 name3
you’d like to see?
STEP III. Create a Newline Notice that the NULL is missing from Like to talk about your experiences
Text File the NEWLINE column. That is because with using InterBase as a backend
it now contains a carriage return. Also to your application?
Next create a text file (with an ASCII
note the carriage return value takes two
text editor such as Notepad) that Contact Amelia Arnett at
characters on Windows platforms and 1-888-345-2015 x6506 or
contains a single carriage return. In
one on UNIX. aarnett@interbase.com
this example assume that I have
■ PAGE 2 ■
Q&A: Mary Czaja
Each issue of Intercom features an interview with a key personality.
This month we interview Mary Czaja, Program Manager.
■ PAGE 3 ■
InterBase
Pumps Up
The Volume
At ICon ’98
Amelia Arnett
Technical Support team spirit shines through at “Meet the Team.” L–R: Chip Handley, Scott Schnaars, Senior Sales Executive,
Client Services Manager; Brett Bandy, Sr. Tech. Support Engineer; James Arias-La takes a break during a quiet moment.
Rheir, Tech. Support Engineer; Jenny Li, Tech. Support Engineer; and Markus Kemper,
Client Services and Sales Engineer.
■ PAGE 4 ■
Jim Weil (InterBase President), Rick
LeFaivre (Senior Vice President of R&D,
Inprise), and John Floisand (Senior Vice
President of Worldwide Sales, Inprise)
Jenny Li, Markus Kemper, Shaunak Mistry, and Greg Deatz (ICon ’98 Attendee and
Outside Speaker for the InterBase Track) find time for a cold one after a hard day at
the conference.
■ PAGE 5 ■
GBAK & COPY InterBase In
continued
Action: The
critical environment where InterBase
excels, a weekly backup with GBAK
isolated from other transactions, and
it has a complete view of the data at
Hoehne Group
by Amelia Arnett – from the press
should be a minimum. that point in time. COPY does not. release “InterBase at the Heart of the
COPY misses out in two other Hoehne Group Management+ Software”
A common question is, “Why do I archival opportunities that GBAK
need GBAK when COPY seems to catches – index optimization and The Hoehne Group Software Division,
work, and is COPY quicker than reducing the size of the database. located in Park City, Utah, was
GBAK?” One good way to optimize an index founded in 1991 to provide financial
COPY seems to fit with InterBase. is to build it from scratch. That’s how services for the healthcare industry.
Just like InterBase, COPY is quick and GBAK does it. GBAK doesn’t even Their product, Management+ medical
easy to use, it doesn’t interfere with back-up existing indexes. Instead it practice management software, has
the work of other users, and it is creates them from scratch during the become the most popular product in
available on a variety of platforms. restore process. The creation of their industry. Management+ is used
So it sounds like COPY would work indexes often takes a large part of the by over 200 leading physician’s
for backups. time required to restore a GBAK offices to reduce costs, improve
It almost does. archive. A COPY is faster because it efficiency, and more effectively use
The problem with COPY is related spends no time optimizing indexes. resources. The software seamlessly
to the InterBase versioning engine. There is often a dramatic decrease manages every aspect of a
The versioning engine of InterBase in database size following a GBAK physician’s office, including billing,
maintains a unique virtual database and restore. The decrease in database claims, patient demographics,
for every user. Since every user works size comes from compression of the scheduling, medical records,
on their own version of the database data and a reduction in the number inventory and reporting.
there is very little content on for of Transaction Information Pages
data. The work of maintaining (TIP). InterBase has automatic The Hoehne Group chose InterBase
multiple versions is done by garbage collection but that still as the foundation for Management+
InterBase. leaves holes in the database and running on the Windows operating
If you use COPY as a backup these holes take up space. GBAK very system. InterBase’s ease of
utility, it has no capability of effectively compresses those holes installation, use and maintenance
distinguishing between versions and and returns the disk space to the made it ideal for a physician’s office,
records. COPY simply reads what is customer. where there are usually no IT staff
on the disk. There is a real possibility So when can COPY be used safely available. “As a good consumer, we
that a COPY of an InterBase database as an archival utility? continually compare InterBase to its
will have inconsistant or corrupt If there are no users connected to competition.” said David L. Hoehne,
data. A GBAK of any database, even the database, and the GFIX utility has president and founder of the Moehne
a live database, is a complete and been run to VALIDATE and FIX the Group. “Exceptional price,
safe archive of the data. database you can be confident of performance, power and ease-of-use
Doing a GBAK of a live database getting a good COPY. If you want to are the overwhelming reasons why
makes sense because GBAK operates make sure you have a 100% accurate, we continue to choose InterBase over
just like any other database user. 100% compressed, 100% optimized its competition. As a result, InterBase
When GBAK connects to a database and reindexed database then you allows our system to maintain the
it operates in the scope of a need to use GBAK. feature-rich, user-friendly capabilities
transaction like all other users. that are the benchmark of InterBase.”
Therefore GBAK has the advantages Jule Potter is Technical Marketing
Manager at InterBase Software
of every InterBase user – it is safely Corporation.
■ PAGE 6 ■
5.5 Shines Multiple platform support of a restored database and all its
continued
objects was assigned to the user who
Three InterBase 5.5 ports are performed the restore.
available now—Windows 95 and
own InterBase installation applica- Windows NT on Intel, Solaris on Getting the product
tion, is also available for free down- SPARC, and HP-UX. All InterBase
client and server software is compat- InterBase 5.5 replaces InterBase 5.0
load on the InterBase web site.
ible. For example, a Win32 client can and 5.1.1, and all new purchases will
New ODBC & InterClient drivers communicate with a Solaris server receive version 5.5. To purchase
and vice-versa. InterBase 5.5, see www.inprise.com/
InterBase 5.5 includes a new wheretobuy for U.S. and international
ODBC␣ 3.0 driver from Intersolv. The Other news information on how to contact
driver is compliant with Microsoft’s Inprise Sales.
ODBC␣ 3.0 standard, and has exten- The InterBase setup application has We ship InterBase 5.5 automatic-
sions to allow you to specify interna- been rewritten from scratch and ally as a maintenance update to all
tional character sets and SQL roles. It makes installation much simpler. existing customers who have a
also supports Microsoft ASP and maintenance agreement. Mainten-
other products that require a thread- ance is a great deal and easily pays
safe ODBC driver. The new driver also If your UDF raises an for itself compared to the retail price
features improved performance, relia- of the product. You can purchase
bility, and support for Blobs. exception due to a maintenance within 60 days of
The InterClient 1.5 JDBC driver is purchasing product. The total cost of
many times faster than the previous
defect, InterBase now maintenance is based on all
release. The new driver also supports chargeable components of the
user-specified international character
has the ability to return
customer configuration: activation
sets, improved documentation, ex- a distinct error and user licenses in addition to the
amples, and JBuilder integration. server software itself.
UDF exception handling
message. This is an Other customers can purchase
InterBase 5.5 at upgrade pricing, a
An exciting new feature of InterBase effective development discount off of retail in the U.S. You
5.5 is the exception handler for User- are eligible for this pricing if you
Defined Functions. UDFs allow users
and debugging aid for already own InterBase software.
to add functionality to the InterBase Upgrade pricing will be applied to
server with their own DLLs. InterBase
identifying defects in your existing configuration on a like-
5.5 introduces exception handling for for-like, same-platform basis only.
UDFs before you deploy Additions to an existing configura-
all UDFs. If your UDF raises an
exception due to a defect, InterBase them in a production tion are considered new purchases,
now has the ability to return a not upgrades, even when purchased
distinct error message. This is an environment. at the same time as upgrades.
effective development and debugging Outside the U.S., ask your regional
aid for identifying defects in UDFs Inprise salesperson for upgrade
GBAK has a new option –buffers pricing details.
before you deploy them in a
that allows you to specify the
production environment. UDF
database’s default cache buffers as Bill Karwin is the Technical Publications
exception handling is currently
you restore. Also, GBAK preserves the Manager for InterBase Software
implemented only in the Windows Corporation
original ownership of the database;
95/Windows NT InterBase server.
in previous versions, the ownership
■ PAGE 7 ■
Redirecting Errors to a Text File
James Aria-La Rheir
Some InterBase utilities (for example, GFIX.EXE) don’t offer an output file Step B 2>
switch to redirect on-screen status messages to a text file. Following is an
example of how you can use the operating system to manage this within DOS The shell attaches to the associated
and UNIX. device (a file in this case that holds
The operating system sets up three file descriptors for every process: 0, 1 and the error information) and redirects
2. The operating system determines the associated device for each file the error output to a file.
descriptor. 0 is keyboard input, 1 is the display of standard output and 2 is the
display of error output. You can override those operating system defaults Step C c:\temp\error.txt
devices for any file descriptor. Let’s analyze a command sequence:
The last part is simply the file,
C:\> gfix -f -v c:\temp\employee.gdb 2> c:\temp\error.txt error.txt, receiving the error
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^ output, as redirected by the “2>”
Step: A B C operator.
This is not an InterBase-only
feature. Here is an example of using
a standard operating system utility
Step A gfix -f -v c:\temp\employee.gdb and the redirection feature:
gfix runs and uses the file descriptors in the following way: C:\> dir /r
0 = “gfix –f -v c:\temp\employee.gdb” Invalid switch - “r”.
1 = “” (No output because of error message)
2 = “database file appears corrupt () C:\> dir /r 2>
-bad checksum c:\temp\dir.txt
-checksum error on database page 2"
C:\> type c:\temp\dir.txt
Invalid switch - “r”.
1 0 0 E N T E R P R I S E WAY
S C O T T S V A L L E Y, C A 9 5 0 6 6