Skip to Content.
Sympa Menu

freetds - Re: update a DB

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Gargiullo <gargiullo AT comcast.net>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: update a DB
  • Date: Fri, 29 Mar 2002 12:28:47 -0500


Do I have to quote the values in the query, they are non-numeric?

-----Original Message-----
From: bounce-freetds-143250 AT franklin.oit.unc.edu
[mailto:bounce-freetds-143250 AT franklin.oit.unc.edu]On Behalf Of Michael
Peppler
Sent: Friday, March 29, 2002 10:34 AM
To: TDS Development Group
Subject: [freetds] Re: update a DB


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

---
You are currently subscribed to freetds as: [gargiullo AT comcast.net]
To unsubscribe, forward this message to
$subst('Email.Unsub')





Archive powered by MHonArc 2.6.24.

Top of Page