ACN
create synonym ips_voyages for roris.ips_voyages;
create synonym ips_voyage_members for roris.ips_voyage_members;
create synonym ips_vessels for roris.ips_vessels;
create synonym ips_routes for roris.ips_routes;
create synonym ips_contacts for roris.ips_contacts;
create synonym ips_cargoes for roris.ips_cargoes;
create synonym ips_goods for roris.ips_goods;
create synonym ips_goods_groups for roris.ips_goods_groups;
create synonym ips_vessel_types for roris.ips_vessel_types;
create synonym ips_voyage_locks for roris.ips_voyage_locks;
create synonym ips_vas_um for roris.ips_vas_um;
create synonym ips_vas_echivalent for roris.ips_vas_echivalent;
create synonym ips_grup_tip_nave for roris.ips_grup_tip_nave;
create synonym ips_berthings for roris.ips_berthings;
create synonym ips_route_points for roris.ips_route_points;
create synonym ips_vberthings for roris.ips_vberthings;
create synonym ips_vroute_points for roris.ips_vroute_points;
create synonym ips_aramis_tip_nave for roris.ips_aramis_tip_nave;
create synonym ips_varamis_tip_nave for roris.ips_varamis_tip_nave;
create synonym ips_vvoyages for roris.ips_vvoyages;
create synonym ips_vvoyage_members for roris.ips_vvoyage_members;
create synonym ips_vvessels for roris.ips_vvessels;
create synonym ips_vroutes for roris.ips_vroutes;
create synonym ips_vcontacts for roris.ips_vcontacts;
create synonym ips_vcargoes for roris.ips_vcargoes;
create synonym ips_vgoods for roris.ips_vgoods;
create synonym ips_vgoods_groups for roris.ips_vgoods_groups;
create synonym ips_vvessel_types for roris.ips_vvessel_types;
create synonym ips_vgrupe_vase for roris.ips_vgrupe_vase;
create synonym ips_vvoyage_locks for roris.ips_vvoyage_locks;
create synonym ips_vvas_um for roris.ips_vvas_um;
create synonym ips_vvas_echivalent for roris.ips_vvas_echivalent;
create synonym ips_vgrup_tip_nave for roris.ips_vgrup_tip_nave;
create synonym ips_dane for roris.ips_dane;
	
RORIS	
grant select on roris.ips_route_points to mariusm_auto;
grant references on roris.ips_route_points to mariusm_auto;
grant select on roris.ips_aramis_tip_nave to mariusm_auto;
grant references on roris.ips_aramis_tip_nave to mariusm_auto;
grant select on roris.ips_berthings to mariusm_auto;
grant references on roris.ips_berthings to mariusm_auto;
grant select on roris.ips_voyages to mariusm_auto;
grant select on roris.ips_voyage_members to mariusm_auto;
grant select on roris.ips_vessels to mariusm_auto;
grant select on roris.ips_contacts to mariusm_auto;
grant select on roris.ips_cargoes to mariusm_auto;

grant select on roris.ips_goods to mariusm_auto;
grant select on roris.ips_goods_groups to mariusm_auto;
grant select on roris.ips_vessel_types to mariusm_auto;
grant select on roris.ips_voyage_locks to mariusm_auto;

grant select on roris.ips_vas_um to mariusm_auto;
grant select on roris.ips_vas_echivalent to mariusm_auto;
grant select on roris.ips_grup_tip_nave to mariusm_auto;
grant select on  roris.ips_dane to mariusm_auto;

grant references on roris.ips_voyages to mariusm_auto;
grant references on roris.ips_voyage_members to mariusm_auto;
grant references on roris.ips_routes to mariusm_auto;
grant references on roris.ips_contacts to mariusm_auto;
grant references on roris.ips_cargoes to mariusm_auto;

grant references on roris.ips_goods to mariusm_auto;
grant references on roris.ips_goods_groups to mariusm_auto;
grant references on roris.ips_vessel_types to mariusm_auto;
grant references on roris.ips_voyage_locks to mariusm_auto;

grant references on roris.ips_vas_um to mariusm_auto;
grant references on roris.ips_vas_echivalent to mariusm_auto;
grant references on roris.ips_grup_tip_nave to mariusm_auto;
grant references on  roris.ips_dane to mariusm_auto;

alter table IPS_BERTHINGS add constraint PK_BERTHINGS primary key (ID);
alter table IPS_CARGOES add constraint PK_CARGOES primary key (ID);
alter table IPS_CONTACTS add constraint PK_CONTACTS primary key (ID);
alter table IPS_COUNTRIES add constraint PK_COUNTRIES primary key (ID);
alter table IPS_GOODS add constraint PK_GOODS primary key (ID);
alter table IPS_ROUTE_POINTS add constraint PK_ROUTE_POINTS primary key (ID);
alter table IPS_ROUTES add constraint PK_ROUTES primary key (ID);
alter table IPS_VESSELS add constraint PK_VESSELS primary key (ID);
alter table IPS_VESSEL_TYPES add constraint PK_VESSEL_TYPES primary key (ID);
alter table IPS_VOYAGE_LOCKS add constraint PK_VOYAGE_LOCKS primary key (ID);
alter table IPS_VOYAGE_MEMBERS add constraint PK_VOYAGE_MEMBERS primary key (ID);
alter table IPS_VOYAGES add constraint PK_VOYAGES primary key (ID);



	
UPDATE IPS_TARIFE SET ID_VALUTA = 2 WHERE VALUTA LIKE 'EUR%';
UPDATE IPS_TARIFE_DIVERSE SET ID_VALUTA = 2 WHERE NUMEVALUTA LIKE 'EUR%';
UPDATE IPS_TARIFE_DIVERSE SET ID_VALUTA = 1 WHERE NUMEVALUTA LIKE 'USD%';
UPDATE IPS_TARIFE_DIVERSE SET ID_VALUTA = 0 WHERE NUMEVALUTA LIKE 'LEI%' OR NUMEVALUTA IS NULL;	

 
 
 
drop synonym ips_voyages;
drop synonym ips_voyage_members;
drop synonym ips_vessels;
drop synonym ips_routes;
drop synonym ips_contacts;
drop synonym ips_cargoes;
drop synonym ips_goods;
drop synonym ips_goods_groups;
drop synonym ips_vessel_types;
drop synonym ips_voyage_locks;
drop synonym ips_vas_um;
drop synonym ips_vas_echivalent;
drop synonym ips_grup_tip_nave;
drop synonym ips_berthings;
drop synonym ips_route_points;
drop synonym ips_vberthings;
drop synonym ips_vroute_points;
drop synonym ips_aramis_tip_nave;
drop synonym ips_varamis_tip_nave;
drop synonym ips_vvoyages;
drop synonym ips_vvoyage_members;
drop synonym ips_vvessels;
drop synonym ips_vroutes;
drop synonym ips_vcontacts;
drop synonym ips_vcargoes;
drop synonym ips_vgoods;
drop synonym ips_vgoods_groups;
drop synonym ips_vvessel_types;
drop synonym ips_vgrupe_vase;
drop synonym ips_vvoyage_locks;
drop synonym ips_vvas_um;
drop synonym ips_vvas_echivalent;
drop synonym ips_vgrup_tip_nave;
drop synonym ips_dane;