Changes between Initial Version and Version 1 of INTEGRATING operation


Ignore:
Timestamp:
Dec 6, 2010 1:07:38 PM (14 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • INTEGRATING operation

    v1 v1  
     1 
     2{{{ 
     3#!sql 
     4-- operations 
     5-- changing format of column i 
     6drop table if exists wrbd.operation_op; 
     7 
     8create table wrbd.operation_op ( 
     9op_folio_no character varying(50), 
     10op_st_id character varying(10), 
     11ope_date date, 
     12ope_year integer, 
     13op_area numeric, 
     14op_glass numeric,  
     15op_elver numeric, 
     16op_yellow numeric, 
     17op_silver numeric, 
     18op_not_recorded numeric, 
     19op_eels_anaesthetized text,  
     20op_num_fishing integer, 
     21op_p1 integer, 
     22op_p2 integer, 
     23op_p3 integer, 
     24op_p4 integer, 
     25op_p5 integer, 
     26op_total integer, 
     27op_abundance_rating integer, 
     28op_distribution character varying(15), 
     29op_main_survey_target character varying(20), 
     30opedisthwm numeric, 
     31constraint c_fk_op_code  FOREIGN KEY  (op_st_id) REFERENCES wrbd.station_st(st_id) 
     32); 
     33 
     34 
     35 
     36copy wrbd.operation_op from 'C:/base/Operation_14_Eel_Db_MI_Rivers.csv' with csv delimiter as ';'  ;  
     37copy wrbd.operation_op from 'D:/CelineJouanin/POSEProject/Ireland/DataIreland/Operation_14_Eel_Db_MI_Rivers.csv' with csv delimiter as ';'  ;  
     38-- 966 lines 
     39 
     40alter table wrbd.operation_op add column op_nbsets numeric; 
     41update wrbd.operation_op set op_nbsets=1; 
     42alter table wrbd.operation_op rename column op_num_fishing  to op_nb_pass; 
     43alter table wrbd.operation_op add column op_density numeric; 
     44alter table wrbd.operation_op add column op_equipment character varying(40); 
     45update wrbd.operation_op set op_equipment='Handset'; 
     46alter table  wrbd.operation_op add column op_nbfem integer; 
     47alter table  wrbd.operation_op add column op_nbmal integer; 
     48alter table  wrbd.operation_op add column op_nbimmat integer; 
     49alter table  wrbd.operation_op add column op_nbind integer; 
     50alter table  wrbd.operation_op add column op_totalestim numeric; 
     51alter table  wrbd.operation_op add column op_totalweight numeric; 
     52alter table  wrbd.operation_op rename column ope_year to op_year; 
     53alter table  wrbd.operation_op rename column ope_date to op_date; 
     54copy wrbd.operation_op(op_st_id,op_year,op_equipment,op_area,op_nbsets,op_nb_pass,op_density,op_totalestim,op_totalweight,op_total,op_nbfem,op_nbmal,op_nbimmat) from 'C:/base/8WFD_river_survey_operations.csv' with csv delimiter as ';' header ;  
     55copy wrbd.operation_op from 'D:/CelineJouanin/POSEProject/Ireland/DataIreland/8WFD_river_survey_operations.csv' with csv delimiter as ';'  ;  
     56--984 lines 
     57 
     58alter table wrbd.operation_op add column op_id serial; 
     59alter table wrbd.operation_op add constraint pk_wrbd_operation_op PRIMARY KEY (op_id); 
     60alter table wrbd.operation_op add column op_nbnights integer; 
     61alter table wrbd.operation_op add column op_nbnets integer; 
     62alter table wrbd.operation_op add column op_cpue numeric; 
     63alter table wrbd.operation_op rename column op_total  to op_nbtotal; 
     64 
     65copy wrbd.operation_op(op_st_id,op_year,op_equipment,op_nbnights,op_nbnets,op_nbtotal,op_cpue,op_totalweight,op_nbfem,op_nbmal,op_nbimmat) from 'C:/base/8.lakes_operation.csv' with csv delimiter as ';' header ;  
     66copy wrbd.operation_op(op_st_id,op_year,op_equipment,op_nbnights,op_nbnets,op_nbtotal,op_cpue,op_totalweight,op_nbfem,op_nbmal,op_nbimmat) from 'D:/CelineJouanin/POSEProject/Ireland/DataIreland/8.lakes_operation.csv' with csv delimiter as ';' header ;  
     67}}}