Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

How do I delete a string from my database and update it.

Originally posted as a Categorized Question.

  • Comment on How do I delete a string from my database and update it.

Replies are listed 'Best First'.
Re: How do I delete a string from my database and update it.
by fx (Pilgrim) on Dec 19, 2003 at 23:40 UTC

    The question is vague. It sounds like you want to delete some record from the database. One way to do this would be:

    $dbh->do("delete from table_1 where some_id = 1234");

    ...or if you want to NULL one of the attributes for a record you could:

    $dbh->do("update some_table set some_value=NULL where some_id = 1234") +;

    ...and then call $dbh->commit if AutoCommit is not set, but again the question is really too vague to answer.

      Using placec holders might be a little smarter.

      $sth = $dbh->prepare("delete from table_1 where some_id = ?"); $sth->execute(1234); $sth->execute(undef);

      Less worry about quotes.


      Play that funky music white boy..
Re: How do I delete a string from my database and update it.
by Fastolfe (Vicar) on Nov 25, 2000 at 06:07 UTC