Calling stored procedures like any other function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
Jeff,

Thanks for the information. I'll check out Code Smith.

I have written some tools generate stored procedures and thier calling
methods. I think it would be great if Microsoft would make this whole process
more seamless. I don't like having to define methods in two places. It just
creates maintanance head aches.

Mike
 
Back
Top