25 pts.
 inserting many columns
i want to insert new columns like day1, day2, day3, etc. in a database by passing a veriable in day(n), please help me what i can do for this

Software/Hardware used:
foxpro 2.6
ASKED: October 6, 2012  9:54 AM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question. noor61   25 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Columns would be added to a ‘table’ rather than to a ‘database’. But if you want to “pass a variable”, what are you expecting to “pass” it to? When anyone wants to pass a variable, it usually implies some function or procedure that would be used multiple times with different values. How would you add the columns to a table multiple times? — Tom

 107,695 pts.

 

Sorry Tom, I think you missed the software/hardware used.  This question as stated makes sense for Foxpro which is both a programming language and dbms where each table is called a dbf, data base files.   However, rather than add columns to the table you probably need a second table with a key matching the first table, a day number field which is also part of the key and a value field.  That would start you off with a normalized data structure. Phil

 44,060 pts.

 

Ah, Foxpro… you’re right. I saw the SQL commands and missed Foxpro 2.6. The reference to “database” makes a little more sense.
 
But the basic issue is still the purpose of a “variable” for this. By understanding what is expected of a “variable”, an answer might be possible regardless of the software. Why not simply add the desired columns and be done with it? What business problem is needing to be solved? (Especially for a version that’s going on a couple decades old. If the columns weren’t needed a year ago, what made them important now?)
 
Tom

 107,695 pts.

 

My first recommenadtion would be to review your database design.

 63,535 pts.