Subject | Problem with joined tables and Stored procedures |
---|---|
Author | bamberger_monjaude |
Post date | 2002-08-20T10:17:01Z |
Hi all,
i use a join on two tables and have a big problem!
Select SQL:
SELECT VGZ.ID, VGZ.FINU,...., ART.ID, ART.FINU,.....
FROM VGZ
INNER JOIN ART ON (VGZ.VGZ3 = ART.ID) AND (VGZ.FINU = ART.FINU)
The keys are VGZ.ID, VGZ.FINU and ART.ID AND ART.FINU
To get an updatable dataset, i try to use a stored procedure for
update.
CREATE PROCEDURE MIX_U (
VGZID INTEGER,
VGZFINU INTEGER,
VGKID INTEGER,
...
VGZ6B VARCHAR(1000),
ID INTEGER,
FINU INTEGER,
ART1 SMALLINT,
...
SADT TIMESTAMP,
SCDT TIMESTAMP,
SAU VARCHAR(30),
SCU VARCHAR(30))
AS
BEGIN
UPDATE VGZ
SET VGKID = :VGKID,
VGZ1 = :VGZ1,
VGZ2 = :VGZ2,
VGZ3 = :VGZ3,
VGZ4 = :VGZ4,
VGZ5 = :VGZ5,
VGZ6A = :VGZ6A,
VGZ6B = :VGZ6B
WHERE (ID = :VGZID) AND (FINU = :VGZFINU);
UPDATE ART
SET ART1 = :ART1,
ART2 = :ART2,
ART3 = :ART3,
...
SAU = :SAU,
SCU = :SCU
WHERE (ID = :ID) AND (FINU = :FINU);
END
EditSql of the Query:
EXECUTE PROCEDURE MIX_U(
:VGZ.ID,
:VGZ.FINU,
...
:ART.ID,
:ART.FINU,
:ART.ART1,
... an so on.
If i try to open the Query, i get an access-violation in
the procedure TIB_Row.SysClearBuffers in IBA_Row.imp
I use D5 with IBO 4.2 Hi.
Must i insert a Keylink? Has anyone an idea?
Using stored procedures with one table without join working fine.
With best regards
Elmar Knoerzer
i use a join on two tables and have a big problem!
Select SQL:
SELECT VGZ.ID, VGZ.FINU,...., ART.ID, ART.FINU,.....
FROM VGZ
INNER JOIN ART ON (VGZ.VGZ3 = ART.ID) AND (VGZ.FINU = ART.FINU)
The keys are VGZ.ID, VGZ.FINU and ART.ID AND ART.FINU
To get an updatable dataset, i try to use a stored procedure for
update.
CREATE PROCEDURE MIX_U (
VGZID INTEGER,
VGZFINU INTEGER,
VGKID INTEGER,
...
VGZ6B VARCHAR(1000),
ID INTEGER,
FINU INTEGER,
ART1 SMALLINT,
...
SADT TIMESTAMP,
SCDT TIMESTAMP,
SAU VARCHAR(30),
SCU VARCHAR(30))
AS
BEGIN
UPDATE VGZ
SET VGKID = :VGKID,
VGZ1 = :VGZ1,
VGZ2 = :VGZ2,
VGZ3 = :VGZ3,
VGZ4 = :VGZ4,
VGZ5 = :VGZ5,
VGZ6A = :VGZ6A,
VGZ6B = :VGZ6B
WHERE (ID = :VGZID) AND (FINU = :VGZFINU);
UPDATE ART
SET ART1 = :ART1,
ART2 = :ART2,
ART3 = :ART3,
...
SAU = :SAU,
SCU = :SCU
WHERE (ID = :ID) AND (FINU = :FINU);
END
EditSql of the Query:
EXECUTE PROCEDURE MIX_U(
:VGZ.ID,
:VGZ.FINU,
...
:ART.ID,
:ART.FINU,
:ART.ART1,
... an so on.
If i try to open the Query, i get an access-violation in
the procedure TIB_Row.SysClearBuffers in IBA_Row.imp
I use D5 with IBO 4.2 Hi.
Must i insert a Keylink? Has anyone an idea?
Using stored procedures with one table without join working fine.
With best regards
Elmar Knoerzer