|
|
sybperl-l Archive
Up Prev Next
From: "Fenstermacher, Robert-Contractor"
<rfenste at uswest dot com>
Subject: Re: alter table errors
Date: Jan 20 1999 8:05PM
Dave-
You can add multiple columns at a time in an
alter table, but do NOT repeat the add keyword for
the columns after the first.
your alter table statement should read:
alter table mytable
add k5 numeric(15,15) null,
d5 numeric(15,15) null,
k9 numeric(15,15) null,
d9 numeric(15,15) null,
k13 numeric(15,15) null,
d13 numeric(15,15) null,
k21 numeric(15,15) null,
d21 numeric(15,15) null
I hope this helps-
Robert Fenstermacher
Conversion Specialists, Inc
Denver, CO
fence@xpert.net
---Dave Waller wrote:
>
> I am triing to alter a table to add 6 columns.
>
> In that ASE manual they say you can add them at the same time but both
> SybPerl and isql won't let me.
>
> Here is what I am triing to do:
>
> $sql_stat = qq{
> alter table $table
> add k5 numeric(15,15) null,
> add d5 numeric(15,15) null,
> add k9 numeric(15,15) null,
> add d9 numeric(15,15) null,
> add k13 numeric(15,15) null,
> add d13 numeric(15,15) null,
> add k21 numeric(15,15) null,
> add d21 numeric(15,15) null
> };
> $dbh->dbcmd($sql_stat);
> unless ($dbh->dbsqlexec){
> die "Cannot alter table: statment [$sql_stat] message [
> $dbh->DB_ERROR()]\n"
> }
> print "table altered\n";
>
> I have only got it working if I do it one column at a time.
>
> Dave Waller
>
>
>
>
|