Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some questions about alter table and column 4

Status
Not open for further replies.

monikai

Programmer
Aug 4, 2002
358
PL
Hi !
Can i:
1. change name of column?
2. add two or more columns in one alter table?
3. drop two or more columns in one alter table?
All 'can' progamatically.

Thanks for answers Kind regards from Warszawa!!!!!
I'm inviting all members of T-T to Poland !!!
Monika (monikai@yahoo.com)
 
monikai

1. change name of column?
CREATE TABLE myTable (name c(20),address c(10),phone c(12),city c(30))
ALTER TABLE myTable rename COLUMN name to name1

2. add two or more columns in one alter table?

No, one at a time
ALTER TABLE myTable ADD COLUMN name c(2)

3. drop two or more columns in one alter table?

No, one at a time
ALTER TABLE myTable drop COLUMN phone




Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
thanks, Mike. May be my last questions are stupid, but last tine i sit at computer screen long time and sometimes i don't where, when and who i am Kind regards from Warszawa!!!!!
I'm inviting all members of T-T to Poland !!!
Monika (monikai@yahoo.com)
 
monikai

thanks, Mike. May be my last questions are stupid, but last tine i sit at computer screen long time and sometimes i don't where, when and who i am

A riddle? I don't know the answer. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Monika & Mike,

note that both ADD COLUMN and DROP COLUMN do support multiple fields:

ALTER TABLE myTable ADD COLUMN name c(2) ADD COLUMN name1 c(2) ADD COLUMN name2 c(2)

ALTER TABLE myTable DROP COLUMN name DROP COLUMN name1


Maurizio Zazzi
 
Hi

This is also possible...

ALTER TABLE myTable ADD COLUMN t1 C(5) ;
ADD COLUMN t2 C(5) ;
DROP COLUMN OldT1 ;
DROP COLUMN oldT2

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Ramani and Zazzi

I stand corrected...:~/ Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,
i don't where, when and who i am
it's mistake. Iwant to write:
i don't know where, when and who i am
Thanks to Mike, Zazzi and Ramani Kind regards from Warszawa!!!!!
I'm inviting all members of T-T to Poland !!!
Monika (monikai@yahoo.com)
 
Monikai, this is a rare event,,,,I think I can help...

frmMyForm = CREATEOBJECT('Form') && Create a Form
frmMyForm.Closable = .F. && Disable the window pop-up menu

frmMyForm.AddObject('cmdCommand1','cmdMyCmdBtn') && Add Command button
frmMyForm.cmdCommand1.Visible =.T. && "Who Am I" Command button visible
frmMyForm.SHOW && Display the form
READ EVENTS && Start event processing


DEFINE CLASS cmdMyCmdBtn AS CommandButton && Create Command button
Caption = '\<Who Am I' && Caption on the Command button
Cancel = .T. && Default Cancel Command button (Esc)
Left = 125 && Command button column
Top = 210 && Command button row
Height = 25 && Command button height

PROCEDURE Click
Messagebox(&quot;I am Monikai, I live in Poland, it is &quot;+time())
CLEAR EVENTS && Stop event processing, close form
CLOSE ALL && Close table and database
ENDDEFINE



Hope this helps.. If not Haloperidol 5 mg by mouth as needed until memory returns.

JF
 
Yes, JF. Your answer is very helpful (now I have lazy Saturday afternoon). Do you live in Australia ? And there is the summer ? We have winter with snow, cold etc. I love spring and summer and may be i am so tired in winter Kind regards from Warszawa!!!!!
I'm inviting all members of T-T to Poland !!!
Monika (monikai@yahoo.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top