I use MaxDB Version: 7.6.00.16 Build 016-123-109-428 for LINUX

Then I CALL dbadmin.GetList I have error

Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed
General error;-6003 Duplicate result table name





DROP table test_a
//
create table test_a
(
   a     int not null,
   b     int not null
)
//
insert test_a (a, b) values (1, 1)
//
insert test_a (a, b) values (2, 1)
//
insert test_a (a, b) values (3, 1)
//
drop table test_b
//
create table test_b
(
   a     int not null,
   b     int not null
)
//
insert test_b (a, b) values (1, 1)
//
insert test_b (a, b) values (2, 1)
//
insert test_b (a, b) values (3, 1)
//

DROP FUNCTION DBADMIN.getTest
//
CREATE FUNCTION DBADMIN.getTest
   ( a    INT
   )

RETURNS INT

AS

VAR    id        INTEGER;
BEGIN TRY SELECT b
       FROM
           dbadmin.test_a
                              WHERE
                                  a = :a;
FETCH INTO :id;

                CATCH
                    IF $rc <> 100 THEN
                        STOP($rc, $errmsg);
RETURN id; END;
//

DROP DBPROC dbadmin.GetList

//

CREATE DBPROC dbadmin.GetList
RETURNS CURSOR AS
BEGIN
       TRY
               DECLARE :$CURSOR CURSOR FOR
SELECT a, b FROM dbadmin.test_a where b = DBADMIN.getTest(a)
                   UNION ALL
SELECT a, b FROM dbadmin.test_b where a = DBADMIN.getTest(a);
       CATCH
               IF $RC <> 100 THEN
                       STOP($RC, $ERRMSG);
END;
//


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to