Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    51

    Unanswered: 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

  2. #2
    Join Date
    Feb 2004
    Posts
    78
    Do you receive an error when you just call lsh_Y2KDateString directly?

Posting Permissions

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