Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Aug 21, 2017 12:56 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: SQL adding multi column in one statement
PostPosted: Thu Apr 25, 2013 10:00 am 
Offline

Joined: Sat Mar 15, 2008 8:14 am
Posts: 161
Location: Montreal, Quebec, Canada
Hi everyone
I'v read that i can add multi column to existing table in one statement
But i'v try many ways like.. comma...no comma..braket etc
the only way it work FOR the first of the col added is
ALTER TABLE test ADD COLUMN AE Varchar AF Varchar AG Varchar AH Varchar AI Varchar AJ Varchar AK Varchar AL
It only add the column AE and no error for the rest but no column either
a little help please
Thanks

_________________
--------------------
RB 2011r4 on win7


Top
 Profile  
Reply with quote  
 Post subject: Re: SQL adding multi column in one statement
PostPosted: Thu Apr 25, 2013 10:19 am 
Offline
Site Admin
User avatar

Joined: Fri Sep 30, 2005 9:35 am
Posts: 987
Location: South Portland, Maine
What database are you using?

SQLite only allows you to add a single column at a time using ALTER TABLE ADD COLUMN.

_________________
Paul Lefebvre
Developer Evangelist
Xojo, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: SQL adding multi column in one statement
PostPosted: Thu Apr 25, 2013 1:00 pm 
Offline

Joined: Sat Mar 15, 2008 8:14 am
Posts: 161
Location: Montreal, Quebec, Canada
sorry
im using RealSQL Database
and if its not possible...i have to do a loop ?
ALTER TABLE test ADD COLUMN AE Varchar
ALTER TABLE test ADD COLUMN AF Varchar
ALTER TABLE test ADD COLUMN AG Varchar
ALTER TABLE test ADD COLUMN AH Varchar
ALTER TABLE test ADD COLUMN AI Varchar
Can i commit only once at the end of the loop?
Thanks

_________________
--------------------
RB 2011r4 on win7


Top
 Profile  
Reply with quote  
 Post subject: Re: SQL adding multi column in one statement
PostPosted: Thu Apr 25, 2013 2:04 pm 
Offline
Site Admin
User avatar

Joined: Fri Sep 30, 2005 9:35 am
Posts: 987
Location: South Portland, Maine
Yes, that would work fine.

_________________
Paul Lefebvre
Developer Evangelist
Xojo, Inc.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group