Paul,

I still did not find a way to reply to this mail-list thingy from
behind our proxy, so I hope this message will get through to you.

The function you wish for does not belong into a command-feature or
new method, but you can easily implement it yourself.

To do that, connect with sufficient privileges and query the system
tables via that connection.

select
  SP.RDB$Procedure_ID
from
  RDB$Procedures SP
where
  SP.RDB$Procedure_Name = :PM_TheProcedureName


You can hand the procedure name in question to that query and if you
receive a result, then a procedure with the same name exists in the
database.

I would be aware of the danger that the procedure could probably have
the same name, but maybe it has a different content/effect from the
one you wish to implement/recreate.

In addition I think I remember that only with classic server engine a
listed stored proc is active already for the next connection to the
database.


> Hi 

> I face with this situation:
> Some customers want to have reports or export 'patterns' from fb database.
> For that I have some possibilities as sql query or stored procedures. For
> query I make all by code. For stored procedures I have 2 situation, first,
> SP exist in database, second SP not exist. If SP exist , just run, etc. For
> this case it would be useful to have a method to check if SP exist in
> database, if not, recreate procedure. (this works only for FB2 I think, for
> FB 1.x just create).

> Sample code:
> FBCommand fbCommand1 = new FBCommand();
> fbCommand1.CommandType = CommandType.StoredProcedure;
> if (!fbCommand1.Exists) {fbCommand.Recreate()};

> What do you think about ???

> TIA,
> Paul

  

-- 
Mit freundlichen Grüssen,

André Knappstein, EDV und Controlling
Verwaltungs- und Erlebniszentrum Marina Rünthe
beta Eigenheim GmbH
Hafenweg 4
59192 Bergkamen-Rünthe

Durchwahl: +49 2389 9240 140


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to