Search code examples
databasepervasive-sql

Find all columns in a Pervasive database


I want to find all the columns with a name that includes a specific string using PSQL in a Pervasive database. How do I do that?


Solution

  • You can query the X$Field table for your string. Something like:

    select file.xf$name, field.xe$name from x$field field 
    join x$file file on xe$file = xf$id
    where xe$name like '%some string%'
    

    This query should work for both original and v2 (long metadata) databases but would only work if you have the DDFs (FILE.DDF, FIELD.DDF, and INDEX.DDF at a minimum) and have a PSQL database setup pointing to the DDFs.