Subject | Query works but fails in stored procedure |
---|---|
Author | Mags Phangisa |
Post date | 2012-04-06T08:41:53Z |
Hi everyone,
The following query works fine when called from the application:
"SELECT MBRID,POLNO,PTYPE,BNKDT,AMUNT,ERROR,RECPT
from PYMT where BNKDT>='$sttdt' and BNKDT<='$enddt'"
However, the following stored procedure (using the same above query) throws
an error:
SET TERM ^ ;
CREATE PROCEDURE SPS_PYMT (SDT Date, EDT Date )
RETURNS (MBR Date, POL Varchar(20), PTY Char(4), BNK Date, AMU
Decimal(10,2), ERR Char(4), REC Varchar(10) )
AS
BEGIN
FOR
SELECT MBRID,POLNO,PTYPE,BNKDT,AMUNT,ERROR,RECPT
from PYMT where BNKDT>=:SDT and BNKDT<=:EDT
INTO :MBR,:POL,:PTY,:BNK,:AMU,:ERR,:REC
DO
SUSPEND;
END^
It throws the following error:
Conversion error from string "2241" At procedure 'SPS_PYMT' line: 15, col: 2
This error comes up even when I execute the procedure directly from
Flamerobin.
This is how I call it in the application, in case it is relevant:
$qry = ibase_prepare($tt,"select * from SPS_PYMT('$sttdt','$enddt')");
$rslt = ibase_execute($qry);
while($rec = ibase_fetch_object($rslt))
{
...
}
Thanx,
Mags
[Non-text portions of this message have been removed]
The following query works fine when called from the application:
"SELECT MBRID,POLNO,PTYPE,BNKDT,AMUNT,ERROR,RECPT
from PYMT where BNKDT>='$sttdt' and BNKDT<='$enddt'"
However, the following stored procedure (using the same above query) throws
an error:
SET TERM ^ ;
CREATE PROCEDURE SPS_PYMT (SDT Date, EDT Date )
RETURNS (MBR Date, POL Varchar(20), PTY Char(4), BNK Date, AMU
Decimal(10,2), ERR Char(4), REC Varchar(10) )
AS
BEGIN
FOR
SELECT MBRID,POLNO,PTYPE,BNKDT,AMUNT,ERROR,RECPT
from PYMT where BNKDT>=:SDT and BNKDT<=:EDT
INTO :MBR,:POL,:PTY,:BNK,:AMU,:ERR,:REC
DO
SUSPEND;
END^
It throws the following error:
Conversion error from string "2241" At procedure 'SPS_PYMT' line: 15, col: 2
This error comes up even when I execute the procedure directly from
Flamerobin.
This is how I call it in the application, in case it is relevant:
$qry = ibase_prepare($tt,"select * from SPS_PYMT('$sttdt','$enddt')");
$rslt = ibase_execute($qry);
while($rec = ibase_fetch_object($rslt))
{
...
}
Thanx,
Mags
[Non-text portions of this message have been removed]