Subject Re: [firebird-support] Re: a few How To......s
Author Martijn Tonies
Hi,

> > You can only get users logged in into a specific database
> > by using the Services API.
>
> This means that one cannot also get thelist of all the databases
> present on the DataServer (this is separate computer).

Correct, Firebird doesn't know about datafiles unless
you tell it to attach to them.

> > by issueing:
> > select * from rdb$relations where rdb$view_blr is null
> > and rdb$system_flag is null or rdb$system_flag = 0
>
> This means I will have to mess with SystemTable for this. That is a
> bit frightning for me as I am a beginner in FB.
>
> Isn't there SQL Select facility like 'SELECT * FROM Tab' to retrive a
> list of all the Tables in a database?

What would "Tab" be in this case? I'm telling you, it's RDB$RELATIONS.

Selecting from system tables is no problem, it's done in many systems.

If you're scared, just create this view :-)

CREATE VIEW ALL_TABLES AS
select * from rdb$relations where rdb$view_blr is null
and rdb$system_flag is null or rdb$system_flag = 0

and it will look just like Oracle ;)


> See rdb$relation_fields
> >
>
> Again it is frightining to mess with System Table.
>
> I think there should be some facility for retriving the complete
> Schema of a Database.

See above. The system tables is where all the info is.

> Does any know of any such Undocumented function or has any created any
> UDF for this?

UDFs cannot return resultsets.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com