Skip to Content.
Sympa Menu

freetds - Re: [freetds] Perl insert query

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "nitin" <nitin.v AT bplmail.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Perl insert query
  • Date: Mon, 24 Mar 2003 09:57:53 +0530

It works now.

Thanx a lot.

----- Original Message -----
From: "Vecchio, Peppi" <PVecchio AT orangelake.com>
To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
Sent: Monday, March 24, 2003 7:08 PM
Subject: RE: [freetds] Perl insert query


> I found that I had to 'quote' my variables before inserting them. Not
sure
> why it's different then your single quotes in the VALUES ('a',).
>
> Try something like this:
>
> my $a1 = $dbh->quote( $zip );
> my $sql = qq/
> INSERT INTO employee_info
> ( zip ) VALUES ( $a1 )
> /;
> my $rv = $dbh->do( $sql );
>
> Let me know if this does/doesn't help.
>
> Peppi Vecchio | Web Developer
> TECHNOLOGY SERVICES GROUP
>
>
>
> -----Original Message-----
> From: nitin [mailto:nitin.v AT bplmail.com]
> Sent: Sunday, March 23, 2003 6:56 AM
> To: freetds AT lists.ibiblio.org
> Subject: [freetds] Perl insert query
>
>
> I've created a database called 'test' in MS SQL 7. When every i try to
> insert a query using perl on Linux, i get the following error:
>
> DBD::Sybase::db do failed: Server message number=208 severity=16 state=1
> line=1 server=STREAM text=Invalid object name 'test'. at test.pl line 10.
>
> The perl code is:
>
> #!/usr/bin/perl
> use DBI;
>
> $ENV{'SYBASE'} = '/usr/local/freetds' unless $ENV{'SYBASE'};
> my $dbh = DBI->connect('dbi:Sybase:server=test','test','test');
> my $sql = qq/
> INSERT INTO test
> VALUES ('a','b',1)
> /;
> my $rv = $dbh->do( $sql );
>
> $dbh->disconnect;
>
>
> Can someone help me!!!!!!!!!
>
> Thanx a lot
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page