Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2008
    Posts
    1

    Unanswered: 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 07:11.

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Have you tried it? What error do you get?
    What version of PSQL are you using?
    You might have to escape any single quotes. So for your call it might be:

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

    Note, those are two single quotes.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •