×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Avoiding extra file creation on Create Table

Avoiding extra file creation on Create Table

Avoiding extra file creation on Create Table

(OP)
When I CREATE a table, four MDK files are actually created in the directory.  If the table name is "SMALLTABLE", I get these four files:

SMALLTABLE.MDK
SMALLTABLE000.MDK
SMALLTABLE001.MDK
SMALLTABLE002.MDK

I understand what the first one is, but what are the other three?  How do I get rid of them?  This is only going to be a small table, having 3 backups seems unnecessary.

Thanks.

RE: Avoiding extra file creation on Create Table

What's your CREATE TABLE statement?
What version of PSQL are you using?
If I issue the following statement, I only get one file (small.mkd):
CREATE TABLE SMALL (F1 integer, F2 char(10), F3 char(20))
Does it generate four files for you?

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
http://www.mirtheil.com

RE: Avoiding extra file creation on Create Table

(OP)
Hi,

Thanks for the response!!

I am using Pervasive v 8.0

My Create statement is the equivalent of this:

CREATE TABLE (F1 integer, F2 char(10), F3 char(20))

I have heard that there might be a setting somewhere in pervasive that allows tables to grow to over 2 GB and these extra files allow that to happen.  Does your "SMALL" keyword prevent this from happening?

-J

RE: Avoiding extra file creation on Create Table

Actually, "SMALL" in the example I gave is the table name. You would see a "SMALL.MKD" file in the directory where the DDFs exist.  My example could just as easily be written as:
CREATE TABLE MySmallTable(F1 integer, F2 char(10), F3 char(20))
THere is a setting to set the size of the extension files (file segments for data files that are over 2GB) but that wouldn't apply on a CREATE TABLE statement.  The extension files are only created when the file size reaches the threshold on the size.

DOes my example cause 4 files?  
What happens if you run your statement against DEMODATA (the Pervasive sample database)?  Does it create 4 files there?
If not, the problem might be with the DDFs.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
http://www.mirtheil.com

RE: Avoiding extra file creation on Create Table

(OP)
mirtheil,

No, your example does not create 4 seperate tables.  

I am using Delphi's ADOQuery to run a query through Pervasive.  At first, I thought that the problem might lie in Delphi, but I ran your query there too, with the same results: only one table was created.

Why, then, does the following query create 2 tables:  N49OEDAT.MDK, N49OEDAT000.MDK ?

CREATE TABLE N49OEDAT (
ORDUNIQ      char   (12) NOT NULL,
"USER"       char   (12) NOT NULL,
"AUTHORIZED" INT         ,
"AUTHUSER"   char   (6)  ,
"LOCKED"     INT         ,
"IROUTE"     char   (20) ,
"OROUTE"     char   (20) ,
"BROKER"     char   (10) ,
"CONTAINER"  char   (10) )

It seems to depend on the query.  Sometimes a *000.MDK file is created, sometimes *000.MDK AND *001.MDK are also created.

All I want is for ONE file to be created by one CREATE statement.  There must be a setting somewhere in Pervasive that is causing multiple files to be created.

RE: Avoiding extra file creation on Create Table

It only creates one file for me.  The only way I was able to generate files with *000.MKD was when I already had a Btrieve file but the name as the table name.  For example:
Create Table Test1 (f1 char (10), f2 char(10))#
drop table Test1 in dictionary#
create table Test1 (f1 char(10), f2 char(10), f3 char(10))

The first Create Table will create a table with a file name of Test1.mkd. The Drop Table will remove the reference in the DDFs (but leaves test1.mkd).  The second create table will create a table definition in the DDFs but the data file will be named table1000.mkd.

Sounds like you've already got data files with the same name as the table.  

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
http://www.mirtheil.com

RE: Avoiding extra file creation on Create Table

(OP)
mithreil,

Thanks for your help!!  I think you nailed it.  

How does the CREATE TABLE work if there's already data there?  Shouldn't it fail?  

Don't I have to DROP the table before it will allow me to create another?

Once again, you've been a tremendous help.

-Jordan

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close