Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avoiding extra file creation on Create Table 1

Status
Not open for further replies.

NegaScout

Programmer
Dec 6, 2005
7
CA
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.
 
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.
 
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
 
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.
 
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.
 
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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top