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.
> >
>
> In MS SQL (Which I have used once very extensively) I am used to this
> feature. We get the complete list of all the database present on the
> server.
>
> Looking from another angle this is good thing.
>
> BTW where does FB store its data files on the server?

Where you tell it to store the datafiles. Different databases
don't have to be in the same place either.

> > > > 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.
>
> I got what you are telling me. I am just suggesting that there should
> be a predefined SELECT statement which returns a dataset which is
> readonly.
>
> That is all!

Resultsets are always read only. However, "under the hood",
your access components/libraries could be generating INSERT
or UPDATE statements for you if you do something from the
GUI.

If you like, you can start read-only transactions though.

> > > Does any know of any such Undocumented function or has any created any
> > > UDF for this?
> >
> > UDFs cannot return resultsets.
>
> Oh! I did not know about that.

If you come from a MS SQL Server world, UDFs means "User
Defined Functions" which are really Stored Functions (T-SQL
functionality that be can used as a function).

In Firebird, UDFs are also called User Defined Functions, but
are really "External Functions", routines in a DLL that can be
used as a function. Something similar to Extended Procedures
in SQL Server. These external functions (as I always like to call
them) do not have a connection or transaction context.

Hope this helps.

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