IMSMA3 script changes 6.0: Difference between revisions

From IMSMA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 14: Line 14:
==Scripts==__NOEDITSECTION__  
==Scripts==__NOEDITSECTION__  
=== SQL syntax===__NOEDITSECTION__  
=== SQL syntax===__NOEDITSECTION__  
{{Note | It is strongly recommended to copy all SQL statements to a SQL tool like PGadminIII or NaviCat and test them before running the script in {{IMSMANG}} 6.0}}
Due to PostGreSQL is case sensitive you need to adopt SQL statements by adding " around column names that contains capital case and because of the " you also need to add \ (escape character).
Due to PostGreSQL is case sensitive you need to adopt SQL statements by adding " around column names that contains capital case and because of the " you also need to add \ (escape character).


Line 24: Line 25:
SELECT \"Loc_VillageGUID\", \"mMREID\" FROM loc_link_mre WHERE \"Loc_VillageGUID\" IS NOT NULL
SELECT \"Loc_VillageGUID\", \"mMREID\" FROM loc_link_mre WHERE \"Loc_VillageGUID\" IS NOT NULL
</pre>  
</pre>  
In PostGreSQL there are other reserved word than in MySQL. In your SQL tool you will see them marked with blue text.
[[Image:Reserved_word1.png|800px]]
<div align="center">
''How it looks like in SQL tool before correction''
</div>
[[Image:Reserved_word2.png|800px]]
<div align="center">
''How it looks like in SQL tool after correction''
</div>
[[Image:Reserved_word3.png|800px]]
<div align="center">
''How it looks like in integrated into the script''
</div>
=== Data type Byte===__NOEDITSECTION__  
=== Data type Byte===__NOEDITSECTION__  
In PostGreSQL the data type Byte has been replaced with Boolean. You find all places you need to change by searching for ''Byte''.
In PostGreSQL the data type Byte has been replaced with Boolean. You find all places you need to change by searching for ''Byte''.

Revision as of 20:50, 23 June 2014

Importing data to PostGreSQL

If you have imported data to temporary tables, you need to double-check how your data looks like after import to PostGreSQL. There are changes in date format and boolean compared to MySQL.

Configuration files

Compared to IMSMANG 5.08.04 these rows are changed:

  1. MIGRATION_FROM_TYPE=6.0
  2. MIGRATION_TO_TYPE=6.0
  3. IMSMA_6.0_JDBC_URL=jdbc:postgresql://localhost:5432/imsma
  4. IMSMA_6.0_Driver=org.postgresql.Driver
  5. IMSMA_6.0_User=imsma
  6. IMSMA_6.0_Password=password

Scripts

SQL syntax

It is strongly recommended to copy all SQL statements to a SQL tool like PGadminIII or NaviCat and test them before running the script in IMSMANG 6.0

Due to PostGreSQL is case sensitive you need to adopt SQL statements by adding " around column names that contains capital case and because of the " you also need to add \ (escape character).

5.08.04 example

SELECT Loc_VillageGUID, mMREID FROM loc_link_mre WHERE loc_link_mre.Loc_VillageGUID IS NOT NULL

needs to be changed to

SELECT \"Loc_VillageGUID\", \"mMREID\" FROM loc_link_mre WHERE \"Loc_VillageGUID\" IS NOT NULL

In PostGreSQL there are other reserved word than in MySQL. In your SQL tool you will see them marked with blue text.

How it looks like in SQL tool before correction

How it looks like in SQL tool after correction

How it looks like in integrated into the script

Data type Byte

In PostGreSQL the data type Byte has been replaced with Boolean. You find all places you need to change by searching for Byte. 5.08.04 example

Attribute.SetByte("IsActive"), Cast.Byte("1");

needs to be changed to

Attribute.SetBoolean("Active"), Cast.Boolean("true");