#! perl -w scipt use strict; use warnings; use DBI; use DBD::ODBC; my ($data_source, $database, $user_id, $password) = qw( ************ *********** ******** *********); my $conn_string = "driver={SQL Server}; Server=$data_source; Database=$database; Trusted_Connection=yes"; my $dbh = DBI->connect( "DBI:ODBC:$conn_string" ) or die $DBI::errstr; my $Stored_procedure; my $Standardisation; my $Disease_cat; my $Sex; my $Sex_code; my $Constraint_ref; my $ICD_start_9; my $ICD_end_9; my $ICD_start_10; my $ICD_end_10; my $ICD_start_9_B; my $ICD_end_9_B; my $ICD_start_10_B; my $ICD_end_10_B; my $ICD_start_9_C; my $ICD_end_9_C; my $ICD_start_10_C; my $ICD_end_10_C; my $yearfrom; my $yearto; my $min_age; my $max_age; my $region; my $Instance_name; my $Geo_scope; my $number_of_years; my $unique_identifier; my $Query; $Stored_procedure = "make_geo_mortality_count_C_test"; $Standardisation = "\"EuropeanStandard\""; $Disease_cat = "\"All_Cancer\""; $Sex = 1; $Sex_code = "\"MF\""; $Constraint_ref = 1; $ICD_start_9 = "\"A140\""; $ICD_end_9 = "\"A208\""; $ICD_start_10 = "\"C45\""; $ICD_end_10 = "\"C97\""; $ICD_start_9_B = "\"A140\""; $ICD_end_9_B = "\"A208\""; $ICD_start_10_B = "\"C45\""; $ICD_end_10_B = "\"C97\""; $ICD_start_9_C = "\"A140\""; $ICD_end_9_C = "\"A208\""; $ICD_start_10_C = "\"C45\""; $ICD_end_10_C = "\"C97\""; $yearfrom = 2003; $yearto = 2004; $min_age = 0; $max_age = 75; $region = "\"Community\""; $Instance_name = "\"Random_place\""; $Geo_scope = "\"Random_town\""; $number_of_years = ($yearto - $yearfrom)+1; $unique_identifier = "\"tttttttttttttttttttttttttttttttttttt\""; $Query = "EXEC ".$Stored_procedure." ".$Standardisation.", ".$Disease_cat.", ".$Sex.", ".$Sex_code.", ".$Constraint_ref.", ".$ICD_start_9.", ".$ICD_end_9.", ".$ICD_start_10.", ".$ICD_end_10.", ".$ICD_start_9_B.", ".$ICD_end_9_B.", ".$ICD_start_10_B.", ".$ICD_end_10_B.", ".$ICD_start_9_C.", ".$ICD_end_9_C.", ".$ICD_start_10_C.", ".$ICD_end_10_C.", ".$yearfrom.", ".$yearto.", ".$min_age.", ".$max_age.", ".$region.", ".$Instance_name.", ".$Geo_scope.", ".$number_of_years.", ".$unique_identifier."\;"; print "$Query"; my $sthB_A = $dbh->prepare("$Query") or die "Couldn't prepare query: ".$dbh->errstr; $sthB_A->execute() or die "Couldn't execute query: ".$sthB_A->errstr;