Making changes in a Table... Interbase 
Author Message
 Making changes in a Table... Interbase

Hi Everyone,

I have an interbase database and have an employee table in it. One of the
columns "Title" was designed for a size of 20 which I now need to increase
to 40. If I try to make any changes in the delphi database explorer, it says
all the contents of the table will be lost while saving the new size of the
column.

I can't loose all the information and would like to know if there is a way
in which I could change the size of the table-column and at the same time
save the previously entered data in the database.

Thanks.
Vishnu



Wed, 18 Jun 1902 08:00:00 GMT  
 Making changes in a Table... Interbase
1. create a new table with the same structure as the old one, except
that it has the larger field.
2. copy all the records into the new table.
3. delete the old table.
4. rename the new table to the old name.

HTH,
Dan

Quote:

>Hi Everyone,

>I have an interbase database and have an employee table in it. One of the
>columns "Title" was designed for a size of 20 which I now need to increase
>to 40. If I try to make any changes in the Delphi database explorer, it says
>all the contents of the table will be lost while saving the new size of the
>column.

>I can't loose all the information and would like to know if there is a way
>in which I could change the size of the table-column and at the same time
>save the previously entered data in the database.

>Thanks.
>Vishnu

--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control: Consulting, Software,
and the only comprehesive textbook on this subject.
visit us at www.cmdcsystems.com
[Remove the SPAM from my e-mail address]


Wed, 18 Jun 1902 08:00:00 GMT  
 Making changes in a Table... Interbase
Thanks for the reply.
How do I copy records into the new table from the Database Explorer?

Vishnu
***********************************


Quote:
> 1. create a new table with the same structure as the old one, except
> that it has the larger field.
> 2. copy all the records into the new table.
> 3. delete the old table.
> 4. rename the new table to the old name.

> HTH,
> Dan


> >Hi Everyone,

> >I have an interbase database and have an employee table in it. One of the
> >columns "Title" was designed for a size of 20 which I now need to
increase
> >to 40. If I try to make any changes in the Delphi database explorer, it
says
> >all the contents of the table will be lost while saving the new size of
the
> >column.

> >I can't loose all the information and would like to know if there is a
way
> >in which I could change the size of the table-column and at the same time
> >save the previously entered data in the database.

> >Thanks.
> >Vishnu

> --
> Dan Brennand
> CMDC systems, inc.
> Configuration Management and Document Control: Consulting, Software,
> and the only comprehesive textbook on this subject.
> visit us at www.cmdcsystems.com
> [Remove the SPAM from my e-mail address]



Wed, 18 Jun 1902 08:00:00 GMT  
 Making changes in a Table... Interbase
Thanks for the reply.
How do I copy records into the new table from the Database Explorer?

Vishnu
***********************************


Quote:
> 1. create a new table with the same structure as the old one, except
> that it has the larger field.
> 2. copy all the records into the new table.
> 3. delete the old table.
> 4. rename the new table to the old name.

> HTH,
> Dan


> >Hi Everyone,

> >I have an interbase database and have an employee table in it. One of the
> >columns "Title" was designed for a size of 20 which I now need to
increase
> >to 40. If I try to make any changes in the Delphi database explorer, it
says
> >all the contents of the table will be lost while saving the new size of
the
> >column.

> >I can't loose all the information and would like to know if there is a
way
> >in which I could change the size of the table-column and at the same time
> >save the previously entered data in the database.

> >Thanks.
> >Vishnu

> --
> Dan Brennand
> CMDC systems, inc.
> Configuration Management and Document Control: Consulting, Software,
> and the only comprehesive textbook on this subject.
> visit us at www.cmdcsystems.com
> [Remove the SPAM from my e-mail address]



Wed, 18 Jun 1902 08:00:00 GMT  
 Making changes in a Table... Interbase
Use Insert statement. Look at the Sql help for more detail.

Regards
Mani


Quote:
> Thanks for the reply.
> How do I copy records into the new table from the Database Explorer?

> Vishnu
> ***********************************



> > 1. create a new table with the same structure as the old one, except
> > that it has the larger field.
> > 2. copy all the records into the new table.
> > 3. delete the old table.
> > 4. rename the new table to the old name.

> > HTH,
> > Dan


> > >Hi Everyone,

> > >I have an interbase database and have an employee table in it. One of
the
> > >columns "Title" was designed for a size of 20 which I now need to
> increase
> > >to 40. If I try to make any changes in the Delphi database explorer, it
> says
> > >all the contents of the table will be lost while saving the new size of
> the
> > >column.

> > >I can't loose all the information and would like to know if there is a
> way
> > >in which I could change the size of the table-column and at the same
time
> > >save the previously entered data in the database.

> > >Thanks.
> > >Vishnu

> > --
> > Dan Brennand
> > CMDC systems, inc.
> > Configuration Management and Document Control: Consulting, Software,
> > and the only comprehesive textbook on this subject.
> > visit us at www.cmdcsystems.com
> > [Remove the SPAM from my e-mail address]



Wed, 18 Jun 1902 08:00:00 GMT  
 Making changes in a Table... Interbase
The following should set the fieldlength of MYTABLE.MYFIELD to 40 (if you are
using a character set where 1 character uses 1 byte).
There is a post on this in the MERS Knowledgebase.

update rdb$fields
set rdb$field_length = 40,
    rdb$character_length = 40
where rdb$field_name =
   (select rdb$field_source
   from rdb$relation_fields
   where rdb$relation_name = 'MYTABLE'
    and  rdb$field_name = 'MYFIELD'
   )

Note the UpperCase MYTABLE and MYFIELD.

Aage J.

Quote:

> Hi Everyone,

> I have an interbase database and have an employee table in it. One of the
> columns "Title" was designed for a size of 20 which I now need to increase
> to 40. If I try to make any changes in the Delphi database explorer, it says
> all the contents of the table will be lost while saving the new size of the
> column.

> I can't loose all the information and would like to know if there is a way
> in which I could change the size of the table-column and at the same time
> save the previously entered data in the database.

> Thanks.
> Vishnu



Wed, 18 Jun 1902 08:00:00 GMT  
 Making changes in a Table... Interbase

Quote:

>How do I copy records into the new table from the Database Explorer?

One way would be to use an INSERT statement. To use another table as the
source of data for the INSERT, use a SELECT subquery.

  INSERT INTO Target
  SELECT *
  FROM Source

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski              "Health nuts are going to feel stupid someday,
Felton, CA                  lying in hospitals dying of nothing."
                                                              -- Redd Foxx



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Making run-time property changes permanent?

2. TPW: How can I change attributes from recourde made dialogs

3. Changing of structure Paradox-tables (Table Language)

4. making new tables from old, and keeping default values

5. Making Paradox table password protected

6. Need Help making Ascii File into Table!

7. TechTips: What makes a Paradox table go corrupt

8. REQ: Insert records in Interbase table from Paradox table

9. Interbase Password and User add/change via Delphi?

10. Changing access privileges on Interbase databse

11. Interbase - how to change primary key?

12. How can I change date format in Interbase

 

 
Powered by phpBB® Forum Software