Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread CREATE TABLE with variant name in procedure
Sat, Oct 3 2009 9:17 AMPermanent Link

Joerg
Hi,
I wonder why this is working:

SCRIPT
BEGIN       

 DECLARE Tablename VARCHAR(225);
 SET Tablename = 'Test';
                                                                                        
 EXECUTE IMMEDIATE
   'CREATE TABLE '+Tablename+' (UUID GUID)'
 ;

--  CALL CreateDefaultTableLayout('Test');

END

and this is not:

PROCEDURE "CreateDefaultTableLayout" (IN "Tablename" VARCHAR(255) COLLATE ANSI)
BEGIN    
 EXECUTE IMMEDIATE
   'CREATE TABLE '+Tablename+' (GUID UUID)'
 ;
END

has anyone an idea for me?
Sat, Oct 3 2009 11:21 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Joerg,

<< I wonder why this is working: >>

You're reversing the GUID and UUID identifiers:

PROCEDURE "CreateDefaultTableLayout" (IN "Tablename" VARCHAR(255) COLLATE
ANSI)
BEGIN
 EXECUTE IMMEDIATE
   'CREATE TABLE '+Tablename+' (GUID UUID)'  <<<<<<<<<<<<<<<<
 ;
END

--
Tim Young
Elevate Software
www.elevatesoft.com

Sat, Oct 3 2009 11:47 AMPermanent Link

Joerg
Hi Tim,
Yes, thank you.
I changed that, but I still get #700 when I try the procedure, that looks like that now:

PROCEDURE "CreateDefaultTableLayout" (IN "Tablename" VARCHAR(255) COLLATE ANSI)
BEGIN    
 EXECUTE IMMEDIATE
   'CREATE TABLE '+Tablename+' (UUID GUID)'
 ;
END

Any idea?

-------------------------------------------------
"Tim Young [Elevate Software]" wrote:

Joerg,

<< I wonder why this is working: >>

You're reversing the GUID and UUID identifiers:

PROCEDURE "CreateDefaultTableLayout" (IN "Tablename" VARCHAR(255) COLLATE
ANSI)
BEGIN
 EXECUTE IMMEDIATE
   'CREATE TABLE '+Tablename+' (GUID UUID)'  <<<<<<<<<<<<<<<<
 ;
END

--
Tim Young
Elevate Software
www.elevatesoft.com
Tue, Oct 6 2009 12:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Joerg,

<< Yes, thank you.
I changed that, but I still get #700 when I try the procedure, that looks
like that now: >>

It works fine here.  What is the error message that you're getting now, and
does it occur during the creation of the procedure, or the execution of the
procedure ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Image