Unix Technical Forum

alter table in a stored procedure

This is a discussion on alter table in a stored procedure within the DB2 forums, part of the Database Server Software category; --> Hi, In a stored procedure, If i use "alter table <tablename> activate not logged intially with empty table", i ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 08:15 AM
tojigneshshah@gmail.com
 
Posts: n/a
Default alter table in a stored procedure

Hi,

In a stored procedure,

If i use "alter table <tablename> activate not logged intially with
empty table", i get SQL104n error.

If i use "execute immediate alter table <tablename> activate not logged
initially with empty table" then i get SQL0107n (saying max.length is
64 characters)

Please advice.

Regards,
Jignesh

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 08:15 AM
Serge Rielau
 
Posts: n/a
Default Re: alter table in a stored procedure

tojigneshshah@gmail.com wrote:
> Hi,
>
> In a stored procedure,
>
> If i use "alter table <tablename> activate not logged intially with
> empty table", i get SQL104n error.
>
> If i use "execute immediate alter table <tablename> activate not logged
> initially with empty table" then i get SQL0107n (saying max.length is
> 64 characters)

DECLARE txt VARCHAR(32000);
SET txt = 'ALTER TABLE .....';
EXECUTE IMMEDIATE txt;

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 08:15 AM
tojigneshshah@gmail.com
 
Posts: n/a
Default Re: alter table in a stored procedure

thanks


Serge Rielau wrote:
> tojigneshshah@gmail.com wrote:
> > Hi,
> >
> > In a stored procedure,
> >
> > If i use "alter table <tablename> activate not logged intially with
> > empty table", i get SQL104n error.
> >
> > If i use "execute immediate alter table <tablename> activate not logged
> > initially with empty table" then i get SQL0107n (saying max.length is
> > 64 characters)

> DECLARE txt VARCHAR(32000);
> SET txt = 'ALTER TABLE .....';
> EXECUTE IMMEDIATE txt;
>
> Cheers
> Serge
>
> --
> Serge Rielau
> DB2 Solutions Development
> IBM Toronto Lab
>
> IOD Conference
> http://www.ibm.com/software/data/ond...ness/conf2006/


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:04 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com