Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pervasive SQL query

Tags:

sql

pervasive

Does anyone have a query to search all columns in all tables in a Pervasive database for a specific value?

I am struggling to find any info on this.

Seems easy to do in sql server but not with Pervasive.

like image 496
user3280386 Avatar asked Dec 21 '25 13:12

user3280386


1 Answers

--returns a list of all tables sorted by table name: Select * from X$File order by xf$name

--returns a list of all columns (in order) and their attributes for a table called "Person": select X$Field.* from X$Field, X$File where xe$File = xf$id and xf$name = 'Person' and xe$DataType < 200 order by xe$offset

You could use some sort of stored procedure to run through them all. This is a SQL server stored proc that you might be able to use as a guide.

http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

like image 71
Squiggs. Avatar answered Dec 24 '25 02:12

Squiggs.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!