in reply to update db problem

I suspect your problem is that you are not committing changes. I believe you will get your desired result by modifying your commmand to read:

$cmd = $connString."update [dbname].[record] set record = 7\nGO\ncommit\nquit\n";

but am not certain because I never do this with raw SQL(untested). Why are you not using the DBI module that provides an incredibly useful and powerful API?

Replies are listed 'Best First'.
Re^2: update db problem
by mybend (Initiate) on Jun 14, 2010 at 15:54 UTC
    Adding commit didn't work unfortunately. I'm quite new to perl. I'm gonna look up at the DBI module! Thanks!
      This is not a Perl issue (perl is the program, Perl is the language). This is a database issue. As it stands, you are essentially using Perl to assemble commands for your database and then dispatching them using the command line. Therefore, if you want to debug statements, it makes sense to get them working on the command line first.
        If I run exactly the same syntax just from the command line, it does work, but as soon as I put it in $cmd from the script, it doesn't. Btw, I have tried to use DBI, but in order to set the connection there are quite a few steps which I cannot do due to some reasons :(