Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Why I can't alter this procedure?
Fri, Oct 17 2008 4:00 AMPermanent Link

I guess EDBmgr has a bug that prevents ALTERing procedures with no
parameters. Try it yourself:

Create this procedure

  EXECUTE IMMEDIATE 'CREATE PROCEDURE "DropAllTables" ()
BEGIN
 DECLARE TBCursor CURSOR FOR TBStmt;
 DECLARE TBName VARCHAR DEFAULT '''';      
 EXECUTE IMMEDIATE ''ALTER GPHISTOR DROP CONTRAINT FKEMPLEADO'';
 PREPARE TBStmt FROM ''SELECT * FROM Information.Tables'';
 OPEN TBCursor;
 FETCH FIRST FROM TBCursor (Name) INTO TBName;
 WHILE NOT EOF(TBCursor) DO
   IF (LEFT(UPPER(TBName),2) = ''GP'') THEN
     EXECUTE IMMEDIATE ''DROP TABLE "'' + TBName + ''"'';
   END IF;
   FETCH NEXT FROM TBCursor (Name) INTO TBName;
 END WHILE;
 CLOSE TBCursor;
END
';

Try to alter it in EDBmgr (just inserting a comment). You get an
error: "Expected data type but instead found )"


Tiago Ameller
tiago put_an-a-_in_a_circle sistemasc.net
Sistema, S.C.
Fri, Oct 17 2008 3:13 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Tiago,

Try to alter it in EDBmgr (just inserting a comment). You get an error:
"Expected data type but instead found )" >>

Where are you putting the comment ?  I'm not seeing the error that you're
describing, and here's how I modified it:

PROCEDURE "DropAllTables" ()
BEGIN
-- Test  <<<<<<<<<<<<< Added this
 DECLARE TBCursor CURSOR FOR TBStmt;
 DECLARE TBName VARCHAR DEFAULT '';
 EXECUTE IMMEDIATE 'ALTER GPHISTOR DROP CONTRAINT FKEMPLEADO';
 PREPARE TBStmt FROM 'SELECT * FROM Information.Tables';
 OPEN TBCursor;
 FETCH FIRST FROM TBCursor (Name) INTO TBName;
 WHILE NOT EOF(TBCursor) DO
   IF (LEFT(UPPER(TBName),2) = 'GP') THEN
     EXECUTE IMMEDIATE 'DROP TABLE "' + TBName + '"';
   END IF;
   FETCH NEXT FROM TBCursor (Name) INTO TBName;
 END WHILE;
 CLOSE TBCursor;
END

--
Tim Young
Elevate Software
www.elevatesoft.com

Sat, Oct 18 2008 3:09 AMPermanent Link

Tim,

>Where are you putting the comment ?  I'm not seeing the error that you're
>describing, and here's how I modified it:

Just two lines down you did. I'm using 2.02 b1

Now, I see the error is not in all databases, just in one. I'll send
you a database backup and a screen shot.

Tiago Ameller
tiago put_an-a-_in_a_circle sistemasc.net
Sistema, S.C.
Mon, Oct 20 2008 2:40 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Tiago,

<< Now, I see the error is not in all databases, just in one. I'll send you
a database backup and a screen shot. >>

Per my email response, I'm still not seeing the error here with your backup
that you sent.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Oct 20 2008 4:19 PMPermanent Link

Tim,

>Per my email response, I'm still not seeing the error here with your backup
>that you sent.

Received. It's very strange. As said Galileo, "eppur si muove". Here
is failing. Wich actor I'm missing in this test?

Tiago Ameller
tiago put_an-a-_in_a_circle sistemasc.net
Sistema, S.C.
Mon, Oct 20 2008 10:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Tiago,

<< Received. It's very strange. As said Galileo, "eppur si muove". Here is
failing. Wich actor I'm missing in this test? >>

I'm not sure what the issue is.  The catalog will be backed up and restored
as part of the backup, so it isn't like that would be an issue (restoring
the backup instead of using a copy of the catalog).

I've tried this over 30 times now, and I simply cannot get the EDB Manager
to issue an exception.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Oct 21 2008 2:40 AMPermanent Link

Tim

>I've tried this over 30 times now, and I simply cannot get the EDB Manager
>to issue an exception.

Here fails every time, no one was right. I hope this error will raise
again in other scenario and then you can reproduce it.

At the moment is not problem for me, just drop and create procedure
again with changes made in code is enought if needed to modify it.

Tiago Ameller
tiago put_an-a-_in_a_circle sistemasc.net
Sistema, S.C.
Image