Hello monks! I'm here seeking for help and guidance. The main part of my code is the following:
for my $i ($new->{'minrow'} .. $new->{'maxrow'}){ for my $j ($new->{'mincol'} .. ($new->{'maxcol'} - 1)){ $cell = $worksheetloop->get_cell($i, 0); $CodColab = $cell->value(); $cell = $worksheetloop->get_cell(1, $j); $CodTecno = $cell->value(); $cell = $worksheetloop->get_cell($i, $j); $cellVal = $cell->value(); if(!defined($cell) or $cell->value() eq ""){ $cellVal = 0; } $sqlCom = "INSERT INTO Level (Codigo, Nivel, DataAval, + CodColab, CodTecno) VALUES (?, ?, ?, ?, ?)"; $sth = $dbh->prepare($sqlCom); $sth->bind_param(1, $counter); $sth->bind_param(2, $cellVal); $sth->bind_param(3, "2014-02-04"); $sth->bind_param(4, $CodColab); $sth->bind_param(5, $CodTecno); print "$sqlCom\n"; getc(); $sth->execute(); $counter++; } }
It should Insert those values at a table called Level, but it wont insert. It says "Execute failed: Syntax error on insert into statement (SQL-42000)" I've checked the table, its fields and values, everything and it should be okay, but its not. And thats why I'm here seeking for help. Someone, please? NOTE: I found the problem. The table name is a SQL Reserved Word. Thank you!

In reply to [SOLVED] Perl, Excel and MS Access Database (SQL-42000) by PaiMei

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.