普遍的SQL查询 [英] Pervasive SQL query

查看:87
本文介绍了普遍的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.

在SQL Server中似乎很容易实现,但在Pervasive中则不然.

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

推荐答案

您不需要存储过程.您可以使用以下查询来做到这一点:

You don't need a stored procedure. You can do it with this query:

select x$file.xf$name, X$Field.* from X$Field, X$File 
where xe$File = xf$id and 
xe$DataType < 200 
and xe$name = '<Column Name>'
order by xe$offset

更改为要查找的列的名称.
例如,要查找名为名称"的列,可以使用以下语句:

Changing to the name of the column you are looking for.
For example, to find a column named "Name", you would use the statement:

select x$file.xf$name, X$Field.* from X$Field, X$File 
where xe$File = xf$id and 
xe$DataType < 200 
and xe$name = 'Name'
order by xe$offset

结果为:

Xf$Name                 Xe$Id   Xe$File   Xe$Name                Xe$DataType   Xe$Offset   Xe$Size   Xe$Dec   Xe$Flags
====================   ======   =======   ====================   ===========   =========   =======   ======   ========
Course                     86        13   Name                             0           0         7        0          1
Dept                       92        14   Name                             0           0        20        0          1
Class                      68        12   Name                             0           4         7        0          1

这篇关于普遍的SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆