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 > Testing Stored Procedure results

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-25-04, 03:58
KimballJohnson KimballJohnson is offline
Registered User
 
Join Date: Aug 2004
Posts: 51
Testing Stored Procedure results

I'm trying to test stored procedures.

A very helpful person in this forum suggested creating a 'wrapper procedure' for procedures that use OUT parameters.

However, when I run these wrappers, I get the following error, even when there is no syntax in the proc for returning records.

ODBC Error: SQLSTATE = S1000, Native error code = -5014
Procedure returning result set not allowed in triggers or nested calls.

here's an example procedure:

CREATE PROCEDURE lsh_Y2KDateStringWrapper();
BEGIN
DECLARE :txtDate varchar(10) = '123154';
CALL lsh_ClientRatesList(:txtDate);
PRINT :txtDate;
END;

CREATE PROCEDURE lsh_Y2KDateString(INOUT :txtDate varchar(10))
AS
BEGIN

DECLARE :mn char(2);
DECLARE :dy char(2);
DECLARE :yr char(2);
DECLARE :cy char(2);

SET :mn = SUBSTR(:txtDate,1,2);
IF LEFT(:mn,1) = '0' THEN
SET :mn = SUBSTR(:mn,2,1);
END IF;
SET :dy = SUBSTR(txtDate,3,2);
IF LEFT(:dy,1) = '0' THEN
SET :dy = SUBSTR(:dy,2,1);
END IF;
SET :yr = SUBSTR(:txtDate,5,2);
if (CONVERT(:yr,integer) > 50) THEN
SET :cy = '19';
ELSE
SET :cy = '20';
END IF;
--yecch...
SET :txtDate = (RTRIM(LTRIM(:mn)) + '/' + RTRIM(LTRIM(:dy)) + '/' + RTRIM(LTRIM(:cy)) + RTRIM(LTRIM(:yr)));
END;

It's clearly a missing syntax in the inner procedure that isn't telling Pervasive exactly what's supposed to happen. But I'm lost.

Thanks,

Kimball
Reply With Quote
  #2 (permalink)  
Old 08-30-04, 03:09
Dilyias Dilyias is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
Do you receive an error when you just call lsh_Y2KDateString directly?
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

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