Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: CONCAT Perl or SQL

by Itatsumaki (Friar)
on Dec 03, 2003 at 15:38 UTC ( #311925=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://311925]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2020-05-26 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (150 votes). Check out past polls.

    Notices?