I don't know what your fields are but it looks like you're trying to store the MBRID - presumably identifier - into a date field for output. When you just issue a select that will work, but when you use an SP it fails. Check your code, or cast(MBRID) as date
Alan J Davies Aldis On 06/04/2012 11:42, Mags Phangisa wrote: > 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] > > ------------------------------------ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Visit http://www.firebirdsql.org and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links ! Also search the knowledgebases at http://www.ibphoenix.com ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/firebird-support/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/firebird-support/join (Yahoo! ID required) <*> To change settings via email: firebird-support-dig...@yahoogroups.com firebird-support-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: firebird-support-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/