Analytica Business Systems: Pervasive.SQL and Btrieve Specialists

Pervasive.SQL, Btrieve and More KnowledgeBase | Article #65 | Missing Views, Triggers or Stored Procedures
View an Article   Back
Title: Missing Views, Triggers or Stored Procedures 
Category: Pervasive.SQL PSQL (Any Version) 
Keywords: missing, views, triggers, stored procedures, view.ddf, trigger.ddf, proc.ddf, X$ 
Description: Problem:
You have created some views, triggers, or stored procedures and have been using them successfully but find that you can no longer access them from within the PCC, to edit them, for instance. You may be receiving the error "Unable to open table: X$Proc (or X$View or X$Trigger)".

This can be caused by an update from your software vendor or a restore from an old backup made prior to the time you created the views, triggers or stored procedures in question. What has happened is that file.ddf (the table X$File), field.ddf (X$Field) and index.ddf (X$Index) have been replaced and there are no entries in those tables for view.ddf (X$View), trigger.ddf (X$Trigger) and/or proc.ddf (X$Proc). The physical files containing the views, triggers and/or stored procedures still exist, which is why they still function when you invoke them.

Let's assume that you lack access to all three: Views, triggers, and stored procedures. Here's what to do:
1. Temporarily rename view.ddf to view.old, trigger.ddf to trigger.old and proc.ddf to proc.old.
2. Create a view. Call it anything.
3. Create a trigger. Call it anything.
4. Create a stored procedure. Call it anything.
5. Close all applications that might have the DDFs open, especially the PCC.
6. Delete the new view.ddf, trigger.ddf and/or proc.ddf.
7. Rename view.old back to view.ddf, trigger.old back to trigger.ddf, and proc.old back to proc.ddf.
8. You should be back in business. 

If you like our free Pervasive Knowledge Base Service, please consider purchasing your next Pervasive Software Product from our online store or call or email us!

In the meantime, to help us keep this service free, would you mind clicking on one of the ads at the left? Thanks for visiting!