Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 15 of 15 total
Thread Script bug?
Mon, Jun 23 2008 12:26 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Its getting weirder. Just re-installed b2 and its working fine. Since the
conversion routine is pulling data from my live system (DBISAM until I
finish my epic journey to ElevateDB) it changes each time I do a conversion.
So it looks as though its data related in some way that b1 handled fine but
b2 threw a wobbly over. >>

Yeah, so far I can't reproduce it here either.  I'll keep trying, though.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Jun 23 2008 12:32 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

One other thing I've noticed is that you're mixing a declared WITH RETURN
cursor with an EXECUTE of a CREATE TABLE statement.  That could be part of
the problem.  You really don't want to declare a cursor with the WITH RETURN
clause unless you really intend to return a cursor from the script.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Jun 23 2008 1:33 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

Its gone. I promise I'll get my head round that eventually.


Roy Lambert
Mon, Jun 23 2008 1:45 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


I just realised where I got the template for the script from

SCRIPT (IN SQLStatement VARCHAR, IN TableName VARCHAR, IN IdxSet VARCHAR)
BEGIN     
DECLARE InfoCursor SENSITIVE CURSOR FOR InfoStmt;
DECLARE ResultCursor SENSITIVE CURSOR WITH RETURN FOR ResultStmt;

PREPARE InfoStmt FROM 'SELECT * FROM Information.Tables WHERE Name=?';
OPEN InfoCursor USING TableName;

IF (ROWCOUNT(InfoCursor) > 0) THEN
 EXECUTE IMMEDIATE 'DROP TABLE "'+TableName+'"';
END IF;

CLOSE InfoCursor;

PREPARE ResultStmt FROM 'CREATE TABLE "'+TableName+'" AS '+SQLStatement+' WITH DATA';
EXECUTE ResultStmt;

IF IdxSet IS NOT NULL THEN
 PREPARE ResultStmt FROM 'CREATE INDEX Idx ON "'+TableName+'"('+IdxSet+')';
 EXECUTE  ResultStmt;
END IF;
END

Do you recognise this Mr Young?

Somehow I don't feel as bad about not comprehending WITH RETURN anymore <vbg>

Roy Lambert
Mon, Jun 23 2008 2:01 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I just realised where I got the template for the script from >>

Sorry, I whipped that up in about 5 minutes when you needed it, so there's
always a good chance that something I've copied and pasted is not entirely
correct.

--
Tim Young
Elevate Software
www.elevatesoft.com

« Previous PagePage 2 of 2
Jump to Page:  1 2
Image