"Reflecting" upon stored procedure signatures?

  • Thread starter Thread starter Ben Rush
  • Start date Start date
B

Ben Rush

Hello,

We use stored procedures extensively in Oracle and I thought an interesting
thing to do would be to examine the signature of a stored procedure and
then, using reflection emit, create stub functions for these stored
procedures in, say, C#. That way the idea of having a generic function like
....

CallStoredProcedure(string ProcedureName, string[] parameters);

would be gone and I could have something like

DoSomething(String value1, Int32 value2);

Which exactly mimics the signature of a stored procedure. Using ADO.NET, do
you know if this is possible to "reflect" upon stored procedures like this?
I'm starting to dig through my ADO.NET book right now, but any pointers or
thoughts would be beneficial.

Thanks,
Ben
 
If anyone has anything else to add, then please do, but I just figured it
out.


select *

from ALL_PROCEDURES AP

where AP.PROCEDURE_NAME = <BLAH>



select *

from ALL_ARGUMENTS AA

where AA.OBJECT_NAME = <BLAH>

and variations upon that.
 
Has anyone figured out how to get data length for string parameters?
Samples below returns procedure's parameters ("ARGUMENT_NAME") and
parameter's DATA_LENGTH but only for numeric data_types.

-joopa-



Ben Rush said:
If anyone has anything else to add, then please do, but I just figured it
out.


select *

from ALL_PROCEDURES AP

where AP.PROCEDURE_NAME = <BLAH>



select *

from ALL_ARGUMENTS AA

where AA.OBJECT_NAME = <BLAH>

and variations upon that.


Ben Rush said:
Hello,

We use stored procedures extensively in Oracle and I thought an interesting
thing to do would be to examine the signature of a stored procedure and
then, using reflection emit, create stub functions for these stored
procedures in, say, C#. That way the idea of having a generic function like
...

CallStoredProcedure(string ProcedureName, string[] parameters);

would be gone and I could have something like

DoSomething(String value1, Int32 value2);

Which exactly mimics the signature of a stored procedure. Using ADO.NET, do
you know if this is possible to "reflect" upon stored procedures like this?
I'm starting to dig through my ADO.NET book right now, but any pointers or
thoughts would be beneficial.

Thanks,
Ben
 
Back
Top