On Jun 2, 11:28 am, GregD <[email protected]> wrote:
> Jeremy,
>
> One more question(s). Probably not the last.
>
> A lot of these stored procs have a standard of returning a single
> record with a single column with an error message in it. I'd like to
> capture this in a Sequel::Model class. Can you have Sequel::Model not
> be associated to a database table? How would you cast (not the right
> word) the dataset created from the call_sproc to this Sequel::Model
> class?
I would not recommend Sequel::Model for this. If it is just a single
row/single column containing an error message string:
stored_proc_dataset = DB.dataset
stored_proc_dataset.row_proc = proc{|h| h.values.first}
stored_proc_dataset.call_sproc(:first, :sp_name, :arg1, :arg2) #
should return a string
Sequel datasets do not depend on models (though Sequel models depend
on datasets), so you can use your own model classes with datasets, via
a custom row_proc. In this case, since you are just dealing with a
single error message string, returning the string directly seems to
make the most sense to me.
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.