Dear Monks,

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?


In reply to Creating table DBI by Win

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.