Re: Calling stored procedures like any other function



Mike,

I use stored procedures pretty much exclusively. I use CodeSmith to
generate typesafe wrappers. (www.codesmithtools.com).

Its pretty much automatic and it has saved programmers a lot of time.
(Actually, part of the reason that I ended up using stored procedures soo
much was that codesmith can read the datatypes, parameters, and resultset
directly from the database).

I also like the notion that by writing the template that Codesmith uses I
get EXACTLY what I want.

Here is a sample of how it looks on the outside, this one is an underlying
reader. The WMS672 thing is the stored procedure wrapper. I can use the
same wrapper with a .read and access the values with a
"spwrapper.row.fieldname property."

Dim myBulkWtArray As ArrayList
Dim myWMS672_select_bulkwt_for_item As New wms672_select_bulkwt_for_item

myWMS672_select_bulkwt_for_item.Parms.PkgCodeType = "I"
myWMS672_select_bulkwt_for_item.Parms.Item_no = "SomeItemNumber"

myWMS672_select_bulkwt_for_item.Execute()

myBulkWtArray = myWMS672_select_bulkwt_for_item.getArrayList

jeff

"Mike" <Mike@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FAFC934B-CC2F-467C-923B-EA7F5D8C14B0@xxxxxxxxxxxxxxxx
>I think you should be able to call stored procedures like you do any other
> method. Maybe using the proxy stub pattern like you do for web services
> would work. This would allow type safe compile time checking and save
> programmers a lot of redudant work.


.



Relevant Pages

  • Re: sp_OACreate
    ... you are granted execute privileges to the wrapper, ... these procedures in your own T-SQL stored procedures, ...
    (microsoft.public.sqlserver.dts)
  • Re: sp_OACreate
    ... you are granted execute privileges to the wrapper, ... these procedures in your own T-SQL stored procedures, ...
    (microsoft.public.sqlserver.dts)