On Thu, 25 Jul 2002 15:44:43 -0400 Chad Kellerman <[EMAIL PROTECTED]> wrote:

>    I have an issue using the NOW() command to insert the time into a
> timestamp(14) field in a database:
> 
>    I am using DBI on a Solaris x86 server with Mysql 2.23.51.
> 
>   here is part of the code:
> 
> <snip>
> foreach my $host_db (@db_list) {
>                 my $query = $dbh->prepare (qq{
>                    INSERT INTO tbl_MysqlProcess (hostname, db_name,
> status, inut_time) VALUES(?,?,?,?)
>                 });
>                 $query->execute ("$host_name", "$host_db", "queued",
> NOW());

This snippet is calling Perl function NOW() and sending its result as a
value for the fourth placeholder.  Since you don't have a Perl
function NOW(), that's probably not what you want.

If NOW() is a Mysql function, use it directly in the SQL.

>         }
> <snip>
> 
> a perl -wcT script.pl, shows syntax is ok but when I execute I get:
> 
> Undefined subroutine &main::NOW called at serverBackup.pl line 116.

See?

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.


Reply via email to