in reply to Re: Re: CONCAT Perl or SQL
in thread CONCAT Perl or SQL

my $sql = " UPDATE ICD_9_Disease_Types SET ICD_9_code = CONCAT('A', ICD_9_code) WHERE ICD_9 > 0"; my $sth = $dbh->prepare($sql) or $dbh->errstr(); my $rows_updated = $sth->execute(); print "We updated $rows_updated rows\n";

Replies are listed 'Best First'.
Re: Re: Re: Re: CONCAT Perl or SQL
by Win (Novice) on Dec 03, 2003 at 16:17 UTC
    I don't think that CONCAT works with MS SQL Server. I have tried the following that does not give any error message but does not do what I want either.
    my $sqlB = "update ICD_9_Disease_Types set ICD_9_code = ('A') + IC +D_9 FROM ICD_9 WHERE ICD_9 > 0"; my $sthG = $dbh->prepare($sqlB) or $dbh->errstr(); my $rows_updated = $sthG->execute(); print "We updated $rows_updated rows\n";

    It gives the message:

    We updated 0E0 rows

    I am not really sure what the OEO refers to.