I have a SP that takes two numeric parameters. the SP works perfectly using the Pervasive Control Center.But if i use Crystal Reports 2008 and this SP as my datasource, it will prompt me for the parameters just fine, ......but sending the parameter values back and returning the dataset is not, pervasive sends an error message saying the table is "read-only"which is B.s.security is not restricted, even for tables, the table even has an identity as the pk.looking for ideas?thanks
CREATE PROCEDURE SODLOOP (IN :SONUM INTEGER, IN :NUMBOX INTEGER)
RETURNS(
RECNUM IDENTITY,
SONUM INTEGER,
SHIPNAME VARCHAR(30),
SHIPA1 VARCHAR(30),
SHIPA2_1 VARCHAR(30),
SHIPA2_2 VARCHAR(30),
SHIPCITY VARCHAR(30),
SHIPST VARCHAR(30),
SHIPZIP VARCHAR(30),
SHIPVIA VARCHAR(15),
SHIPATTN VARCHAR(30),
CUSORD VARCHAR(25),
FOB VARCHAR(15),
JOBNUM VARCHAR(15),
INVCODE VARCHAR(1),
SODESC VARCHAR(30),
PHONE_1 VARCHAR(25),
FAX VARCHAR(25)
);
BEGIN
--CLEAR PREVIOUS DATASET
DELETE FROM ASHIPLABEL;
--START LOOP BASED ON NUMBER OF LABELS
DECLARE :LOOPCOUNT INTEGER;
SET :LOOPCOUNT = 1;
INSIDELOOP:
LOOP
INSERT INTO ASHIPLABEL(SONUM,SHIPNAME,SHIPA1,SHIPA2_1,SHIPA2_2,SHIPCITY,SHIPST,SHIPZIP,SHIPVIA,SHIPATTN,CUSORD,FOB,JOBNUM,INVCODE,SODESC,PHONE_1,FAX)
SELECT
SO.BKAR_INV_SONUM,
SO.BKAR_INV_SHPNME,
SO.BKAR_INV_SHPA1,
SO.BKAR_INV_SHPA2_1,
SO.BKAR_INV_SHPA2_2,
SO.BKAR_INV_SHPCTY,
SO.BKAR_INV_SHPST,
SO.BKAR_INV_SHPZIP,
SO.BKAR_INV_SHPVIA,
SO.BKAR_INV_SHPATN,
SO.BKAR_INV_CUSORD,
SO.BKAR_INV_FOB,
SO.BKAR_INV_JOBNUM,
SO.BKAR_INV_INVCD,
SO.BKAR_INV_DESC,
CU.BKAR_TELEPHONE_1,
CU.BKAR_FAX_PHONE
FROM BKARINV SO INNER JOIN BKARCUST CU
ON SO.BKAR_INV_SHPCOD = CU.BKAR_CUSTCODE
WHERE SO.BKAR_INV_SONUM = :SONUM;
IF :LOOPCOUNT = :NUMBOX THEN
LEAVE INSIDELOOP;
END IF;
SET :LOOPCOUNT = :LOOPCOUNT +1;
END LOOP;
SELECT * FROM ASHIPLABEL;
END;
CREATE PROCEDURE SODLOOP (IN :SONUM INTEGER, IN :NUMBOX INTEGER)
RETURNS(
RECNUM IDENTITY,
SONUM INTEGER,
SHIPNAME VARCHAR(30),
SHIPA1 VARCHAR(30),
SHIPA2_1 VARCHAR(30),
SHIPA2_2 VARCHAR(30),
SHIPCITY VARCHAR(30),
SHIPST VARCHAR(30),
SHIPZIP VARCHAR(30),
SHIPVIA VARCHAR(15),
SHIPATTN VARCHAR(30),
CUSORD VARCHAR(25),
FOB VARCHAR(15),
JOBNUM VARCHAR(15),
INVCODE VARCHAR(1),
SODESC VARCHAR(30),
PHONE_1 VARCHAR(25),
FAX VARCHAR(25)
);
BEGIN
--CLEAR PREVIOUS DATASET
DELETE FROM ASHIPLABEL;
--START LOOP BASED ON NUMBER OF LABELS
DECLARE :LOOPCOUNT INTEGER;
SET :LOOPCOUNT = 1;
INSIDELOOP:
LOOP
INSERT INTO ASHIPLABEL(SONUM,SHIPNAME,SHIPA1,SHIPA2_1,SHIPA2_2,SHIPCITY,SHIPST,SHIPZIP,SHIPVIA,SHIPATTN,CUSORD,FOB,JOBNUM,INVCODE,SODESC,PHONE_1,FAX)
SELECT
SO.BKAR_INV_SONUM,
SO.BKAR_INV_SHPNME,
SO.BKAR_INV_SHPA1,
SO.BKAR_INV_SHPA2_1,
SO.BKAR_INV_SHPA2_2,
SO.BKAR_INV_SHPCTY,
SO.BKAR_INV_SHPST,
SO.BKAR_INV_SHPZIP,
SO.BKAR_INV_SHPVIA,
SO.BKAR_INV_SHPATN,
SO.BKAR_INV_CUSORD,
SO.BKAR_INV_FOB,
SO.BKAR_INV_JOBNUM,
SO.BKAR_INV_INVCD,
SO.BKAR_INV_DESC,
CU.BKAR_TELEPHONE_1,
CU.BKAR_FAX_PHONE
FROM BKARINV SO INNER JOIN BKARCUST CU
ON SO.BKAR_INV_SHPCOD = CU.BKAR_CUSTCODE
WHERE SO.BKAR_INV_SONUM = :SONUM;
IF :LOOPCOUNT = :NUMBOX THEN
LEAVE INSIDELOOP;
END IF;
SET :LOOPCOUNT = :LOOPCOUNT +1;
END LOOP;
SELECT * FROM ASHIPLABEL;
END;