Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
11-1-2007 -- The DELETE line is where the problem lies. Here is the code:

use DBI;

$dbh = DBI->connect('dbi:ODBC:Tradchem2005');
#--select * from xcontacts
$sql1 =
"UPDATE xcontacts
where sysparentid in (select sysrowid from clients where loaddate >= (GETDATE()-7)) and contactname <> '' ";

$sql2 = "delete from contacts where sysrowid in (select sysrowid from Xcontacts where newcolumn8 = 'X') ";

$sql2a = "
Insert Contacts Select Address4, AddInterests, Child1Birthday, Child1info, Child1Name, Child2Birthday, Child2Info, Child2Name,
SysRowID, SysRoute, SysParentID, SysDateAdded, SysDateUpdated, Address1, Address2, Address3, CallWhen, City, ColComment,
CustomerName, ContactName, Country, county, Division, EmailAddress, Ext1, Ext2, GoalofCall, HotButton, LastCalled, Leadstatus,
Birthday, PersonalData, PersonalIntr, ZipCode, ReportsTo, Salutation, Specialty, State, Phone1, Phone2, FAXnumber, Title, TypeUpdate,
cellPhone, Pager, SysParentTable, ReportsToID, Child3Birthday, Child3Info, Child3Name, Department, Hobbies, MoveDate, MoveTo,
NewColumn1, NewColumn2, NewColumn3, NewColumn4, NewColumn5, NewColumn6, NewColumn7, NewColumn8, OrphanContact,
Spouse, Spousebd, SpouseInfo, WedAnniv, QBType, PhoneType, ContactIDnumber, ContactNumber, ContactPurpose, CountryPhoneCode,
FirstName, LastName, YearStarted, CorpID, ContactNameOldSys

from Xcontacts where newcolumn8 = 'X'";

$sql3 = "
UPDATE Xcontacts

$sql4 = "
UPDATE contacts

$getinfo = $dbh->prepare($sql1);
$rcount1 = $getinfo->rows;
print OUTFILE ("SQL1 execute finished -- $rcount1 \n");

$getinfo = $dbh->prepare($sql2);
$rcount2 = $getinfo->rows;
print OUTFILE ("SQL2 execute finished -- $rcount2\n");

$getinfo = $dbh->prepare($sql2a);
$rcount2a = $getinfo->rows;
print OUTFILE ("SQL2a execute finished -- $rcount2a\n");

$getinfo = $dbh->prepare($sql3);
$rcount3 = $getinfo->rows;
print OUTFILE ("SQL3 execute finished -- $rcount3\n");

$getinfo = $dbh->prepare($sql4);
$rcount4 = $getinfo->rows;
print OUTFILE ("SQL4 execute finished -- $rcount4\n");

close (OUTFILE);

In reply to Re^2: DBI on windows problem by txtoolman
in thread DBI on windows problem by txtoolman

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others studying the Monastery: (3)
    As of 2016-12-08 01:27 GMT
    Find Nodes?
      Voting Booth?
      On a regular basis, I'm most likely to spy upon:

      Results (133 votes). Check out past polls.