DBI or Mysql UPDATE error?
DBI or Mysql UPDATE error?
am 18.08.2004 15:37:39 von Neil Watson
I'm having an issue with a statement executed through perl. I'm not
sure where the problem lies:
Table:
mysql> describe hardware;
+-------------+------------------+------+-----+------------- ---+----------------+
| Field | Type | Null | Key | Default | Extra
+-------------+------------------+------+-----+------------- ---+----------------+
| hid | int(10) unsigned | | PRI | NULL | auto_increment |
| changed | timestamp(14) | YES | | NULL |
| created | timestamp(14) | YES | | 00000000000000 |
| received | date | YES | | NULL |
| description | text | YES | | NULL |
| model | varchar(35) | YES | | NULL |
| serial | varchar(35) | YES | | NULL |
| poid | int(10) unsigned | YES | | NULL |
| hwtid | int(10) unsigned | YES | | NULL |
| uid | int(10) unsigned | YES | | NULL |
+-------------+------------------+------+-----+------------- ---+----------------+
10 rows in set (0.01 sec)
Statement:
#update if hid is specified
if ($hid != 0){
$statement = "UPDATE hardware SET
description='$description',
model='$model',
hwtid='$hwtid',
serial='$serial',
poid='$poid',
uid='$uid'
WHERE hid='$hid';";
Error:
error: dbh2 = Apache::DBI::db=HASH(0x87011f0) Couldn't execute
statement: UPDATE hardware SET
description='Workstation',
model='',
hwtid='1',
serial='AD750-1489164',
poid='',
uid=''
WHERE hid=2; Unknown column 'model' in 'field list' at
/var/www/itiv/htdocs/admin/comp/insert.mas line 667.
Using Mysql server 4.0.20, DBI 1.38, Perl 5.8.2, Apache DBI 0.92 and
Mason 1.20.
--
Neil Watson | Gentoo Linux
Network Administrator | Uptime 78 days
http://watson-wilson.ca | 2.6.5 AMD Athlon(tm) MP 2000+ x 2
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org
Re: DBI or Mysql UPDATE error?
am 18.08.2004 16:02:57 von Rudy Lippan
On Wed, 18 Aug 2004, Neil Watson wrote:
> Error:
> error: dbh2 = Apache::DBI::db=HASH(0x87011f0) Couldn't execute
> statement: UPDATE hardware SET
> description='Workstation',
> model='',
> hwtid='1',
> serial='AD750-1489164',
> poid='',
> uid=''
> WHERE hid=2; Unknown column 'model' in 'field list' at
> /var/www/itiv/htdocs/admin/comp/insert.mas line 667.
>
Does this work though the mysql shell? Did you try a DBI->trace(9) on the
statement? Are using the correct database, and are you hitting the right
database server?
Rudy
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org
Re: DBI or Mysql UPDATE error?
am 18.08.2004 16:02:57 von Rudy Lippan
On Wed, 18 Aug 2004, Neil Watson wrote:
> Error:
> error: dbh2 = Apache::DBI::db=HASH(0x87011f0) Couldn't execute
> statement: UPDATE hardware SET
> description='Workstation',
> model='',
> hwtid='1',
> serial='AD750-1489164',
> poid='',
> uid=''
> WHERE hid=2; Unknown column 'model' in 'field list' at
> /var/www/itiv/htdocs/admin/comp/insert.mas line 667.
>
Does this work though the mysql shell? Did you try a DBI->trace(9) on the
statement? Are using the correct database, and are you hitting the right
database server?
Rudy
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org
Re: DBI or Mysql UPDATE error?
am 18.08.2004 16:19:24 von Neil Watson
On Wed, Aug 18, 2004 at 10:02:57AM -0400, Rudy Lippan wrote:
>Does this work though the mysql shell?
Yes.
>Did you try a DBI->trace(9) on the >statement?
How do I use that? I tried the line DBI->trace(9); just after a set the
statement but, the error message was the same.
>Are using the correct database, and are you hitting the right
Yes.
>database server?
Yes.
--
Neil Watson | Gentoo Linux
Network Administrator | Uptime 78 days
http://watson-wilson.ca | 2.6.5 AMD Athlon(tm) MP 2000+ x 2
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org
Re: DBI or Mysql UPDATE error?
am 18.08.2004 16:19:24 von Neil Watson
On Wed, Aug 18, 2004 at 10:02:57AM -0400, Rudy Lippan wrote:
>Does this work though the mysql shell?
Yes.
>Did you try a DBI->trace(9) on the >statement?
How do I use that? I tried the line DBI->trace(9); just after a set the
statement but, the error message was the same.
>Are using the correct database, and are you hitting the right
Yes.
>database server?
Yes.
--
Neil Watson | Gentoo Linux
Network Administrator | Uptime 78 days
http://watson-wilson.ca | 2.6.5 AMD Athlon(tm) MP 2000+ x 2
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org
Re: DBI or Mysql UPDATE error?
am 18.08.2004 16:37:20 von Neil Watson
On Wed, Aug 18, 2004 at 10:19:24AM -0400, Neil Watson wrote:
>On Wed, Aug 18, 2004 at 10:02:57AM -0400, Rudy Lippan wrote:
>>Did you try a DBI->trace(9) on the >statement?
>How do I use that? I tried the line DBI->trace(9); just after a set the
>statement but, the error message was the same.
I found the trace info. It was in the apache log.
--
Neil Watson | Gentoo Linux
Network Administrator | Uptime 78 days
http://watson-wilson.ca | 2.6.5 AMD Athlon(tm) MP 2000+ x 2
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org
Re: DBI or Mysql UPDATE error?
am 18.08.2004 16:37:20 von Neil Watson
On Wed, Aug 18, 2004 at 10:19:24AM -0400, Neil Watson wrote:
>On Wed, Aug 18, 2004 at 10:02:57AM -0400, Rudy Lippan wrote:
>>Did you try a DBI->trace(9) on the >statement?
>How do I use that? I tried the line DBI->trace(9); just after a set the
>statement but, the error message was the same.
I found the trace info. It was in the apache log.
--
Neil Watson | Gentoo Linux
Network Administrator | Uptime 78 days
http://watson-wilson.ca | 2.6.5 AMD Athlon(tm) MP 2000+ x 2
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org
Re: DBI or Mysql UPDATE error?
am 18.08.2004 16:45:27 von Neil Watson
On Wed, Aug 18, 2004 at 10:02:57AM -0400, Rudy Lippan wrote:
>Did you try a DBI->trace(9) on the statement?
Trace info:
-> DBI->Apache::DBI::connect(dbi:mysql:licenses, lwriter, ****)
>> FETCH DISPATCH (DBI::dr=HASH(0x86204bc) rc2/9 @2 g0 ima404 pid#26484) at /usr/lib/perl5/vendor_perl/5.8.2/Apache/DBItail: `-100' option is obsolete; use `-n 100' since this will be removed in the future
Ah I see the problem. Damn, this handle was pointed to an older version
of the database. Sorry to have bothered you. Thanks for the trace tip.
--
Neil Watson | Gentoo Linux
Network Administrator | Uptime 78 days
http://watson-wilson.ca | 2.6.5 AMD Athlon(tm) MP 2000+ x 2
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org
Re: DBI or Mysql UPDATE error?
am 18.08.2004 16:45:27 von Neil Watson
On Wed, Aug 18, 2004 at 10:02:57AM -0400, Rudy Lippan wrote:
>Did you try a DBI->trace(9) on the statement?
Trace info:
-> DBI->Apache::DBI::connect(dbi:mysql:licenses, lwriter, ****)
>> FETCH DISPATCH (DBI::dr=HASH(0x86204bc) rc2/9 @2 g0 ima404 pid#26484) at /usr/lib/perl5/vendor_perl/5.8.2/Apache/DBItail: `-100' option is obsolete; use `-n 100' since this will be removed in the future
Ah I see the problem. Damn, this handle was pointed to an older version
of the database. Sorry to have bothered you. Thanks for the trace tip.
--
Neil Watson | Gentoo Linux
Network Administrator | Uptime 78 days
http://watson-wilson.ca | 2.6.5 AMD Athlon(tm) MP 2000+ x 2
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org