If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Syntax in calling sp

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-16-08, 06: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 07:11.
Reply With Quote
  #2 (permalink)  
Old 09-21-08, 23:02
mirtheil mirtheil is online now
Registered User
 
Join Date: Dec 2001
Posts: 1,015
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On