GeODin 8.2: Customising databasesservice.geodin.com/related/english/flyers/software/...GeODin 8.2: A...

5
Publication for customising existing database structures GeODin 8.2: Customising databases © Fugro 2016 GeODin 8.2: A publication can be used for altering existing database structures. In the following example a datatype parameter is renamed and a new publication element is added to close the database. Onshore Geotechnics A publication can make alterations to old database structure by using a series of SQL commands. In this example the structural changes are to rename a parameter from 'OLDNAME' to 'NEWNAME' in the data type WST. Once this has been carried out, objects from the „old“ database can be transferred to the new database. The restructuring can be carried out using four SQL commands: ALTER TABLE GEODIN_MES_WSTTAB01 ADD COLUMN NEWNAME FLOAT UPDATE GEODIN_MES_WSTTAB01 SET NEWNAME = OLDNAME ALTER TABLE GEODIN_MES_WSTTAB01 DROP OLDNAME UPDATE GEODIN_SYS_MESSTRS SET FIELD_NAME = 'NEWNAME', FIELD_LONG = 'NEWNAME' WHERE FIELD_GRP='WST' AND FIELD_NAME='OLDNAME' The publication is shown below: Page of 1 5 For more information please visit www.geodin.com Renaming a data type parameter

Transcript of GeODin 8.2: Customising databasesservice.geodin.com/related/english/flyers/software/...GeODin 8.2: A...

Page 1: GeODin 8.2: Customising databasesservice.geodin.com/related/english/flyers/software/...GeODin 8.2: A publication can be used for altering existing database structures. In the following

Publication for customising existing database structures

GeODin 8.2: Customising databases

© Fugro 2016

GeODin 8.2: A publication can be used for altering existing database structures. In the following example a datatype parameter is renamed and a new publication element is added to close the database.

Onshore G

eotechnics

A publication can make alterations to old database structure by using a series of SQL commands. In this example the structural changes are to rename a parameter from 'OLDNAME' to 'NEWNAME' in the data type WST. Once this has been carried out, objects from the „old“ database can be transferred to the new database. The restructuring can be carried out using four SQL commands:

ALTER TABLE GEODIN_MES_WSTTAB01 ADD COLUMN NEWNAME FLOAT

UPDATE GEODIN_MES_WSTTAB01 SET NEWNAME = OLDNAME

ALTER TABLE GEODIN_MES_WSTTAB01 DROP OLDNAME

UPDATE GEODIN_SYS_MESSTRS SET FIELD_NAME = 'NEWNAME', FIELD_LONG = 'NEWNAME' WHERE FIELD_GRP='WST' AND FIELD_NAME='OLDNAME'

The publication is shown below:

Page � of �1 5For more information please visit www.geodin.com

Renaming a data type parameter

Page 2: GeODin 8.2: Customising databasesservice.geodin.com/related/english/flyers/software/...GeODin 8.2: A publication can be used for altering existing database structures. In the following

The publication is made available for the database and requires the object type 'SSGKRZV1'

For the publication 'SQL commands' the option 'Ignore errors' is checked because if the database already contains the field 'NEWNAME' it must be guaranteed that 1. – the publication doesn’t abort because of this and 2. – the publication doesn’t corrupt the current database structure. Hence great care is necessary when designing publications.

GeODin 8.2: Customising databases

Publication items: name and description

Requirements

© Fugro 2016Page 2 of �5For more information please visit www.geodin.com

Page 3: GeODin 8.2: Customising databasesservice.geodin.com/related/english/flyers/software/...GeODin 8.2: A publication can be used for altering existing database structures. In the following

In the branch 'Tables' of the SQL command, the names of the tables to be used can be defined. This is necessary for databases with schema names because they will be automatically extended in the SQL command.

For the transfer of data field contents from the old to the new fields type-conversions could also be performed. This has to be done in the SQL command. In this example both fields have the same type:

UPDATE GEODIN_MES_WSTTAB01 SET NEWNAME = OLDNAME

The customization of the MESSTRS entry can also be more extensive than in the example shown (e.g. the measurement unit, field format etc. could also be updated).

UPDATE GEODIN_SYS_MESSTRS SET FIELD_NAME = 'NEWNAME', FIELD_LONG = 'NEWNAME' WHERE FIELD_GRP='WST' AND FIELD_NAME='OLDNAME'

GeODin 8.2: Customising databases

© Fugro 2016Page � of �3 5For more information please visit www.geodin.com

Publication items: tables and SQL commands

Page 4: GeODin 8.2: Customising databasesservice.geodin.com/related/english/flyers/software/...GeODin 8.2: A publication can be used for altering existing database structures. In the following

After the publication has been carried out in a database it is not possible to work in the database with GeODin because the structure of the object types, data types etc. has been changed i.e. the database must be closed immediately using the 'Close database' element.

This element MUST be the last element in a publication. The user is shown a confirmation message that the database will be closed.

Since restructuring a database with an incorrect publication can cause the database to become defective, it is recommended to add a hint text to the publication as in the (German) example below. Note that translations are available via the <Translations> button.

GeODin 8.2: Customising databases

© Fugro 2016Page � of �4 5For more information please visit www.geodin.com

Close database

Hint text

Page 5: GeODin 8.2: Customising databasesservice.geodin.com/related/english/flyers/software/...GeODin 8.2: A publication can be used for altering existing database structures. In the following

The publication can now be run in a database (as long as all the conditions have been met).

Confirmation message after the publication has finished:

The current database is automatically closed.

GeODin 8.2: Customising databases

© Fugro 2016Page � of �5 5For more information please visit www.geodin.com

Fugro Consult GmbHWolfener Straße 36U12681 BerlinGermanyTel: +49 (0)1805 346436

Fugro Austria GmbHEinödstraße 138600 Bruck a. d. MurAustriaTel: +43 (0)3862 3430014

GeODin® is registered trademark of the European Union belonging to Fugro Consult, Berlin, Germany.Email: [email protected]