Win has asked for the wisdom of the Perl Monks concerning the following question:
The following code works well.
#! perl -w scipt use strict; use DBI; use DBD::ODBC; my ( $data_source, $database, $user_id, $password ) = qw( ip_adddreaa +First natt silver ); #not real my $conn_string = "driver={SQL Server}; Server=$data_source; Database= +$database; UID=$user_id; PWD=$password"; my $dbh = DBI->connect( "DBI:ODBC:$conn_string" ) or die $DBI::errstr; my $user_specified_table_name = "Doncaster_Deaths 1975_onwards_slim_D" +; create_table($user_specified_table_name); sub create_table ($) { my($table_name) = $_; if (my $table_name eq /Doncaster_Deaths_1975_onwards_slim_D/){ my $sql = qq{ CREATE TABLE Doncaster_Deaths_1975_onwards_slim_D (y +ear_of_death int NOT NULL, ageyear +s int NOT NULL, sex int + NULL, undcaus +e varchar(5) NULL, oacode +varchar(10) NULL, )}; $dbh->do($sql); $dbh->disconnect(); } }
C:\Documents and Settings\Matthew\2003\Perl\November\7_11_03>perl Crea +ting_tabl e_B.pl main::create_table() called too early to check prototype at Creating_t +able_B.pl line 14. Use of uninitialized value in pattern match (m//) at Creating_table_B. +pl line 22 . Use of uninitialized value in string eq at Creating_table_B.pl line 22 +.
Can anyone explain the messages?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating table DBI
by Abigail-II (Bishop) on Nov 10, 2003 at 17:35 UTC | |
|
Re: Creating table DBI
by jeffa (Bishop) on Nov 10, 2003 at 20:28 UTC | |
|
Re: Creating table DBI
by iburrell (Chaplain) on Nov 10, 2003 at 20:36 UTC | |
by jeffa (Bishop) on Nov 10, 2003 at 21:05 UTC | |
|
Re: Creating table DBI
by PodMaster (Abbot) on Nov 11, 2003 at 07:58 UTC | |
|
Re: Creating table DBI
by htoug (Deacon) on Nov 11, 2003 at 11:20 UTC |