Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Scout/HowTo/4.0/Modify a derby database
< Scout | HowTo | 4.0
Revision as of 10:57, 20 April 2014 by Judith.gull.gmail.com (Talk | contribs) (Created page with "{{ScoutPage|cat=HowTo 4.0}} The following how-to explains how you can add other columns to an existing table in your database. The database used in this example is the [[Scou...")
Scout |
Wiki Home |
Website |
Download • Git |
Community |
Forums • Blog • Twitter • G+ |
Bugzilla |
Bugzilla |
The following how-to explains how you can add other columns to an existing table in your database. The database used in this example is the database from the MiniCrm Tutorial
Download and install Derby
Install a binary distribution such as db-derby-10.9.1.0-bin.zip. Switch to the bin subdirectory and start ij.bat. Connect to your database using the same connect string you used for the SQL service.
ij version 10.9 ij> connect 'jdbc:derby:c:/derbydb'; ij>
Operations on the database
Once connected here is how to examine the tables available:
ij> show schemas; TABLE_SCHEM ------------------------------ APP MINICRM ...
ij> show tables in minicrm; TABLE_SCHEM |TABLE_NAME |REMARKS ------------------------------------------------------------------------ MINICRM |COMPANY | MINICRM |COMPANY_FIGURES | MINICRM |CRM_SEQ | ... ij> describe minicrm.company; COLUMN_NAME |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL& ------------------------------------------------------------------------------ COMPANY_NR |DECIMAL |0 |10 |5 |NULL |NULL |NO SHORT_NAME |VARCHAR |NULL|NULL|60 |NULL |120 |NO ...
This is how you might have added the missing column:
ALTER TABLE minicrm.company ADD COLUMN my_new_column int;
Finally:
ij> disconnect; ij> exit;