Subject Re: [firebird-support] How do return the number of object in a Firebird database
Author Josef KokeŇ°
On 17.7.2013 13:55, Softtech Support wrote:
>
>
> Greetings All,
>
> v1.5.3
>
> I need to know how many tables, indicies, functions, stored procedures,
> etc are in my Firebird database.
>
> Is there a quick way to determine this?

-- stored procedures
SELECT COUNT(*)
FROM rdb$procedures
WHERE rdb$system_flag=0

-- functions
SELECT COUNT(*)
FROM rdb$functions
WHERE rdb$system_flag=0

-- indices
SELECT COUNT(*)
FROM rdb$indices
WHERE rdb$system_flag=0

-- tables
SELECT COUNT(*)
FROM rdb$relations
WHERE rdb$system_flag=0
AND rdb$view_blr IS NULL

-- views
SELECT COUNT(*)
FROM rdb$relations
WHERE rdb$system_flag=0
AND rdb$view_blr IS NOT NULL

Josef