I wrote a custom stored procedure that uses inner joins to join 2 tables and return a dataset. Nettiers recognizes that it is a custom stored procedure in my database but I have no way of accessing it through the datasource as a SelectMethod. My code for the SP is below.
My goal is to use this as my select Method and to use the default Insert/Delete/Update methods for all the other actions. The reason for this is that I have a linking table and want to be able to display a human-readable version of the link between regions and zipcodes while in the backend, simply storing their ID's into the link table.
What is the best way to accomplish this? I suppose I could also write custom Insert/Update/Delete procs if needed, but I would like for them to be available through a datasource, like all the other standard methods.
All help would be appreciated, as the deadline for my project is fast approaching and this is a big piece of my dataaccss.
Thanks
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id =
object_id(N'dbo._RegionZipcode_GetJoinedList') AND OBJECTPROPERTY(id,
N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[_RegionZipcode_GetJoinedList]
GO
CREATE PROCEDURE [dbo].[_RegionZipcode_GetJoinedList]
AS
SELECT
[RegionZipcode].[regionzipcodeid],
[RegionZipcode].[regionid],
[RegionZipcode].[zipcodeid],
[Region].[regionname],
[Zipcode].[zip],
[Zipcode].[zipext],
[RegionZipcode].[whencreated],
[RegionZipcode].[lastupdated]
FROM
[dbo].[RegionZipcode]
INNER JOIN [dbo].[Region] ON [Region].[regionid]=[RegionZipcode].[regionid]
INNER JOIN [dbo].[Zipcode] ON [Zipcode].[zipcodeid]=[RegionZipcode].[zipcodeid]
Select @@ROWCOUNT