freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Michael Peppler <mpeppler AT peppler.org>
- To: "TDS Development Group" <freetds AT franklin.metalab.unc.edu>
- Subject: Re: update a DB
- Date: Fri, 29 Mar 2002 07:34:20 -0800
gargiullo AT comcast.net writes:
> I have the following query:
>
> my $dbh = DBI->connect('DBI:Sybase:server=192.168.0.2', $user, $pass)or
> die "Can't connect to database: $DBI::errstr\n" . DBI->errstr;
> my $insert_handle = $dbh->prepare("UPDATE zipcodes SET county=$arr[0],
> areacode=$arr[1] Where zip = $zip") || die "Couldn't prepare queries;
> aborting:\n$!" . $dbh->errstr;
> $insert_handle->execute() or return 0 . dbh->errstr;
> return 1;
>
> But I get the following error.
>
> DBD::Sybase::st execute failed: Server message number=208 severity=16
> state=1 line=1 server=WHITETAIL text=Invalid object name 'zipcodes'. at
> ./zip.pl line 32.
> Can't locate object method "errstr" via package "dbh" at ./zip.pl line 32.
This one's probably just that the "zipcode" table is not in the
default database for the "$user" user.
You can either use $dbh->do("use $database"); (where $database is the
name of the database where the zipcode table is located) or fully
qualify the table in the query:
update $database..zipcode set ... where ...
Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler AT peppler.org *or* mpeppler AT mbay.net
http://www.mbay.net/~mpeppler
International Sybase User Group: http://www.isug.com
-
update a DB,
gargiullo, 03/29/2002
- <Possible follow-up(s)>
- Re: update a DB, Michael Peppler, 03/29/2002
- Re: update a DB, Michael Gargiullo, 03/29/2002
- Re: update a DB, Michael Peppler, 03/29/2002
- Re: update a DB, Michael Gargiullo, 03/29/2002
Archive powered by MHonArc 2.6.24.