Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

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

Reply
 
LinkBack Thread Tools Search this Thread 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 offline
Registered User
 
Join Date: Dec 2001
Posts: 813
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 Search this Thread
Search this Thread:

Advanced Search
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

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