Subject Re: [ib-support] Re: SP question
Author Helen Borrie
At 10:19 AM 03-08-01 +0000, you wrote:
>Hi Sean,
> thanks for your time............
> >
> > You should be able to do it in a single select statement, which
>goes:
> >
> > Select ACCNT_ID, SUM(CHARGE)
> > From JOBS
> > Where COMPLETED between :startDate and :endDate
> > Group By ACCNT_ID
> >
> > Sean
>
>I can't get this to work. I've tried....
>
>SET TERM !! ;
>CREATE PROCEDURE FBS_REPORT_PROC (startDate DATE, endDate DATE)
>RETURNS (account SMALLINT, totalCharge DECIMAL(9,3))
>AS
>BEGIN
> Select ACCNT_ID, SUM(CHARGE) into :account, :totalCharge
> From JOBS
> Where COMPLETED between :startDate and :endDate
> Group By ACCNT_ID;
>END !!
>SET TERM ; !!
>
>and
>
>SET TERM !! ;
>CREATE PROCEDURE FBS_REPORT_PROC (startDate DATE, endDate DATE)
>AS
>BEGIN
> Select ACCNT_ID, SUM(CHARGE)
> From JOBS
> Where COMPLETED between :startDate and :endDate
> Group By ACCNT_ID;
>END !!
>SET TERM ; !!
>
>and various other combinations in my script, but it bombs when run.
>Am I even close?


Steve,
Your Select...into syntax is incorrect. Move the INTO subclause to the end and it should work.

Regards,
Helen


All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________