Subject | Re: Problem with stored procure and Crystal reports |
---|---|
Author | diegodelafuente |
Post date | 2011-06-09T12:25:23Z |
Hi Alexandre.
See this link
http://imageshack.us/photo/my-images/716/errorcr.jpg/
I've uploaded a pic with the error.
i think the problem is not with the SP.
I've tried with another (see SP beloow) and I get this error.
This SP has an input parameter.
http://imageshack.us/photo/my-images/217/errorcr2.jpg/
SET TERM ^ ;
CREATE PROCEDURE RPT_MOVDIARIOSCAJA_SEC (
idsector smallint)
returns (
codigo integer,
caja_operador smallint,
turno integer,
importe numeric(9,2),
movimiento smallint,
fecha timestamp,
hora smallint,
sector smallint,
medico char(1),
recibo_sanatorio char(1),
nrorecibo integer,
tipoiva smallint,
tieneretencion char(1),
idprotocololab integer,
observaciones varchar(100),
pendiente char(1),
nommovimiento varchar(50),
tipo_movimiento varchar(2),
codturno integer,
nommedico varchar(50),
especialidad varchar(5),
hora_turno smallint,
fecha_turno timestamp,
nompaciente varchar(50))
as
begin
for select mdc.codigo,
mdc.caja_operador,
mdc.turno,
mdc.importe,
mdc.movimiento,
mdc.fecha,
mdc.hora,
mdc.sector,
mdc.medico,
mdc.recibo_sanatorio,
mdc.nrorecibo,
mdc.tipoiva,
mdc.tieneretencion,
mdc.idprotocololab,
mdc.observaciones,
mdc.pendiente,
mov.DESCRIPCION, mov.TIPO,
mt.CODIGO, mt.MEDICO, mt.ESPECIALIDAD, mt.HORA_TURNO, mt.FECHA_TURNO,
mp.NOMBRE
from movimientos_diarios_caja mdc
Inner JOIN Movimiento mov ON mdc.MOVIMIENTO = mov.CODIGO
LEFT OUTER JOIN Maestro_Turnos mt ON mdc.TURNO = mt.CODIGO
LEFT OUTER JOIN Maestro_Pacientes mp ON mt.PACIENTE = mp.CODIGO
Where Sector = :idsector
Order BY mov.DESCRIPCION
into :codigo,
:caja_operador,
:turno,
:importe,
:movimiento,
:fecha,
:hora,
:sector,
:medico,
:recibo_sanatorio,
:nrorecibo,
:tipoiva,
:tieneretencion,
:idprotocololab,
:observaciones,
:pendiente,
:nommovimiento,
:tipo_movimiento,
:codturno,
:nommedico,
:especialidad,
:hora_turno,
:fecha_turno,
:nompaciente
do
begin
suspend;
end
end^
SET TERM ; ^
Rgds
Diego
See this link
http://imageshack.us/photo/my-images/716/errorcr.jpg/
I've uploaded a pic with the error.
i think the problem is not with the SP.
I've tried with another (see SP beloow) and I get this error.
This SP has an input parameter.
http://imageshack.us/photo/my-images/217/errorcr2.jpg/
SET TERM ^ ;
CREATE PROCEDURE RPT_MOVDIARIOSCAJA_SEC (
idsector smallint)
returns (
codigo integer,
caja_operador smallint,
turno integer,
importe numeric(9,2),
movimiento smallint,
fecha timestamp,
hora smallint,
sector smallint,
medico char(1),
recibo_sanatorio char(1),
nrorecibo integer,
tipoiva smallint,
tieneretencion char(1),
idprotocololab integer,
observaciones varchar(100),
pendiente char(1),
nommovimiento varchar(50),
tipo_movimiento varchar(2),
codturno integer,
nommedico varchar(50),
especialidad varchar(5),
hora_turno smallint,
fecha_turno timestamp,
nompaciente varchar(50))
as
begin
for select mdc.codigo,
mdc.caja_operador,
mdc.turno,
mdc.importe,
mdc.movimiento,
mdc.fecha,
mdc.hora,
mdc.sector,
mdc.medico,
mdc.recibo_sanatorio,
mdc.nrorecibo,
mdc.tipoiva,
mdc.tieneretencion,
mdc.idprotocololab,
mdc.observaciones,
mdc.pendiente,
mov.DESCRIPCION, mov.TIPO,
mt.CODIGO, mt.MEDICO, mt.ESPECIALIDAD, mt.HORA_TURNO, mt.FECHA_TURNO,
mp.NOMBRE
from movimientos_diarios_caja mdc
Inner JOIN Movimiento mov ON mdc.MOVIMIENTO = mov.CODIGO
LEFT OUTER JOIN Maestro_Turnos mt ON mdc.TURNO = mt.CODIGO
LEFT OUTER JOIN Maestro_Pacientes mp ON mt.PACIENTE = mp.CODIGO
Where Sector = :idsector
Order BY mov.DESCRIPCION
into :codigo,
:caja_operador,
:turno,
:importe,
:movimiento,
:fecha,
:hora,
:sector,
:medico,
:recibo_sanatorio,
:nrorecibo,
:tipoiva,
:tieneretencion,
:idprotocololab,
:observaciones,
:pendiente,
:nommovimiento,
:tipo_movimiento,
:codturno,
:nommedico,
:especialidad,
:hora_turno,
:fecha_turno,
:nompaciente
do
begin
suspend;
end
end^
SET TERM ; ^
Rgds
Diego
--- In firebird-support@yahoogroups.com, Alexandre Benson Smith <iblist@...> wrote:
>
> Hi Diego,
>
> Em 8/6/2011 23:28, diegodelafuente escreveu:
> > Hi.
> >
> > I created a select-SP using IB Expert.
> >
> > SET TERM ^ ;
> >
> > CREATE PROCEDURE ACTUALIZACIONES_S
> > returns (
> > versioncol varchar(5),
> > fechaactualizacion date)
> > as
> > begin
> > for select versioncol,
> > fechaactualizacion
> > from actualizaciones
> > into :versioncol,
> > :fechaactualizacion
> > do
> > begin
> > suspend;
> > end
> > end^
> >
> > SET TERM ;
> >
> > After that I opened CR XI and, using ZStyle IBOLE provider, I tried to open the DB to use the SP created.
> > I could connect to the DB and select the SP from the list.
> > After that, CR shows a Dynamic SQL error.
> >
> > I can access to any table or data using "Add command" option and typing any select sentence.
> >
> > Regards
> > Diego
> >
> >
>
> Show us the correct error message perhaps it could help to identify your
> problem.
>
> I use a pretty old version of Crystal Reports (7.5) and I'm used to use
> Stored Procedures without problem, but I use ODBC instead of OLE/DB.
>
> see you !
>