PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "sue corwin" <scorwin at mediaone dot net>
Subject: RE: Sybase text columns with DBD/DBI?
Date: Jan 26 2000 6:30PM

Sorry everyone...  I was logged in as a different user which did not have
this database as default database -- hence the reason for why I could do it
in ISQL, and not in my Perl script...

I'm learning...

Thanks for the replies.

Sue

-----Original Message-----
From: owner-SYBPERL-L@list.cren.net
[mailto:owner-SYBPERL-L@list.cren.net]On Behalf Of Michael Peppler
Sent: Wednesday, January 26, 2000 12:45 PM
To: SybPerl Discussion List
Subject: Re: Sybase text columns with DBD/DBI?


sue corwin writes:
 >
 > I've got the following simple INSERT STATEMENT that I pass to a prepare
 > and then execute statement...
 >
 > INSERT INTO table1 ( col1, col2, col3,
 > col4, col5 ) VALUES ( 836 ,2 ,'TEST of TEXT FIELD' ,1 ,'just a test...'
 > )
 >
 > where col3 is declared as TEXT field on the table, table1.
 >
 > It works if I run it in ISQL, but not in the Perl script using DBI and
 > Sybase DBD.  I'm using DBI version 1.13 and Sybase DBD 0.19.  Any ideas?


Hmmm... I just tried this with my copy, and it seems to work fine:

#!/usr/bin/perl -w

use DBI;
#DBI->trace(3);

my $dbh = DBI->connect('dbi:Sybase:server=troll;database=testdb', 'sa', '');

my $sth = $dbh->prepare(qq{
INSERT INTO table1 ( col1, col2, col3,
col4, col5 ) VALUES ( 836 ,2 ,'TEST of TEXT FIELD' ,1 ,'just a test...')
});

$sth->execute;

Are you doing something different?

Michael
--
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com