View Single Post
  #1 (permalink)  
Old 09-16-08, 05:42
FranH FranH is offline
Registered User
 
Join Date: Sep 2008
Posts: 1
Syntax in calling stored procedure.

Hi I have a stored proc that takes a 2nd param that contains value '0','BLANDFORD','BOURNEMOUT','CENTRAL'.


Not sure what the syntax of the 2nd param should be in calling the sp.

Call GetSchedApp(0,'0,BLANDFORD,BOURNEMOUT,CENTRAL')


CREATE PROCEDURE GetSchedApp
(
IN :sPaLocation char(10),
IN :sLocations char(250)
)

RETURNS (
diAgIDno integer,
etc...
);

BEGIN

SELECT DISTINCT diAgIDno,diLocation,diResORAgr, diCRSRes ,RsResRef,RsStartDate,RsStartTime, RsEndDate , RsEndTime,RsVehicleGroup,RsVehicleRegno,RsBookingS tatus,HiSurname,HiForename,RsLikelyToExtend,RsExtr aDays,RsAccountCode as AgAccountCode,RsEndDate as AgEndDate,RsEndTime as AgEndTime,1 as AgAgIdItem FROM WorkSchedule INNER JOIN Reservation ON diagIdNo= rsAgIDNo and diLocation=rsAgIdLoc INNER JOIN Hirer ON HiAgIdNo=rsAgIDNo AND HiAgIdLoc=rsAgIdLoc AND HiLicenceNumber= RsLicenceNumber WHERE diLocation IN (SELECT LcLocationRef FROM LocationRM WHERE LcOwningLocRef=:sPaLocation) AND diDiaryNo IN (SELECT SrLastSrNo FROM SerialNo WHERE srlocation IN (:sLocations) AND SrIDType='L') AND RsQuoteReservationFl=0 AND diAgStatus<>'REMOVE' ORDER BY diLocation,RsVehicleGroup,RsVehicleRegno;

END;

Last edited by FranH; 09-16-08 at 06:11.
Reply With Quote