Subject | Re: [IBO] mystery with ParamByName |
---|---|
Author | Gediminas |
Post date | 2004-11-16T13:05:27Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
CREATE PROCEDURE TU(TUID DECIMAL (15, 0))
RETURNS ( SOID DECIMAL (15, 0),NAME VARCHAR (33))
AS
BEGIN
for select
s."SoID",
s."Name"
from TUR t
join PRO p
on t."ProID" = p."ProID"
join AM_KL ak
on p."AKID" = ak."AKID"
join KLA k
on ak."KlaID" = k."KlaID"
join KL_SO ks
on k."KlaID" = ks."KlaID"
join SO s
on ks."SoID" = s."SoID"
where t."TuID" = :TuID and not exists ( select 1 from TU_SO
where "TuID" = :TuID and "SoID" = s."SoID" )
into :SoID, :Name
do
SUSPEND;
end
CREATE PROCEDURE DELTU ( TUID DECIMAL (15, 0), SOID DECIMAL (15, 0))
AS
BEGIN
if ( TuID is null or SoID is null )
then exit;
delete from TU_SO
where "TuID" = :TuID and "SoID" = :SoID;
END
CREATE PROCEDURE INSTU ( TUID DECIMAL (15, 0), SOID DECIMAL (15, 0))
AS
BEGIN
if ( TuID is null or SoID is null )
then exit;
insert into TU_SO
(
"TuID",
"SoID"
)
values
(
:TuID,
:SoID
);
END
// TuID is already provided through the MasterParamsLinks
qry->ParamByName("SoID")->Assign(qry2->FieldByName("SoID"));
qry->Delete();
qry->Refresh();
Hope, that nothing was left...
> Inadequate information is that you don't provide the declarationsfor the
> SPs and you show your dataset SQL as "Select * from..." That isn'tuseful
> when you want people to help you find a problem with a missing field.SSP, insert and delete SP's are:
CREATE PROCEDURE TU(TUID DECIMAL (15, 0))
RETURNS ( SOID DECIMAL (15, 0),NAME VARCHAR (33))
AS
BEGIN
for select
s."SoID",
s."Name"
from TUR t
join PRO p
on t."ProID" = p."ProID"
join AM_KL ak
on p."AKID" = ak."AKID"
join KLA k
on ak."KlaID" = k."KlaID"
join KL_SO ks
on k."KlaID" = ks."KlaID"
join SO s
on ks."SoID" = s."SoID"
where t."TuID" = :TuID and not exists ( select 1 from TU_SO
where "TuID" = :TuID and "SoID" = s."SoID" )
into :SoID, :Name
do
SUSPEND;
end
CREATE PROCEDURE DELTU ( TUID DECIMAL (15, 0), SOID DECIMAL (15, 0))
AS
BEGIN
if ( TuID is null or SoID is null )
then exit;
delete from TU_SO
where "TuID" = :TuID and "SoID" = :SoID;
END
CREATE PROCEDURE INSTU ( TUID DECIMAL (15, 0), SOID DECIMAL (15, 0))
AS
BEGIN
if ( TuID is null or SoID is null )
then exit;
insert into TU_SO
(
"TuID",
"SoID"
)
values
(
:TuID,
:SoID
);
END
> Show the SP exactly as it is defined; and show the DeleteSQLstatement. I
> suspect that the problem will be found there.DeleteSQL calling code:
// TuID is already provided through the MasterParamsLinks
qry->ParamByName("SoID")->Assign(qry2->FieldByName("SoID"));
qry->Delete();
qry->Refresh();
Hope, that nothing was left...