I am new to SQL and am trying to either change the extension of an existing table in a pervasive database or copy the table to a new table.
When I added the table, I assumed Pervasive would use the same extension as the rest of the tables, '.DAT'. It defaulted to '.MKD'. For consistency, I want to end up with my new table having the '.DAT' extension.
I tried the following, unsuccessfully, to make a duplicate table with the correct extension:
sql = "SELECT * INTO TableName USING 'TableName.dat' FROM TableName"
sql = "CREATE TABLE TableName USING 'TableName.dat' SELECT * FROM TableName"
(I doubt it would have worked even if Pervasive had recognized the USING keyword because of the redundant table names.)
Is there a way to just rename the existing table and update the DDF and INDEX tables?
Otherwise my next plan is to create the new empty table properly with the USING keyword, and then copying all the records to the new table.
You need to use an ALTER TABLE statement.
What version of PSQL are you using?
The following works in PSQL v9 (what I'm using):
ALTER TABLE TableName IN DICTIONARY USING 'TableName.dat'
The statement above will rename the underlying data file to "TableName.dat".
For full documentation of ALTER TABLE, see: http://www.pervasive.com/library/doc...ref-04-07.html
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.