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.
Difference between revisions of "Scout/HowTo/3.9/Modify a derby database"
(New page: {{ScoutPage|cat=HowTo 3.9}} The following how-tp explains how you can add other columns to an existing table in your database. The database used in this example is the [[Scout/Tutorial/3....) |
m (how-tp -> how-to) |
||
Line 1: | Line 1: | ||
{{ScoutPage|cat=HowTo 3.9}} | {{ScoutPage|cat=HowTo 3.9}} | ||
− | The following how- | + | 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 [[Scout/Tutorial/3.9/Minicrm/Get_example_database|database from the MiniCrm Tutorial]] |
== Download and install Derby == | == Download and install Derby == |
Latest revision as of 05:23, 24 January 2014
The Scout documentation has been moved to https://eclipsescout.github.io/.
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;