Re: Think there is something DBI

2001-07-18 Thread Abdulaziz Ghuloum
Hello, How about doing this: my @cols = qw(firstname lastname title phone email age location address address2 city state zip zip2 inst school_type grades_taught subjectarea_1 subjectarea_2 subjectarea_3 subjectarea_4 subjectarea_5 subjectarea_6 how_heard Occupation); my $dbh = DBI->connect(.

Re: Think there is something DBI

2001-07-18 Thread syarbrough
I recently had a similar problem, but I took the lazy man's way out and substituted user-typed apostrophes with back quotes, using the following regexp: $message =~ s/'/`/g; Simple, but few people notice the difference between the two characters. Steven Yarbrough -- To unsubscribe, e-mail: [

Re: Think there is something DBI

2001-07-18 Thread Michael Fowler
On Wed, Jul 18, 2001 at 04:27:28PM +0100, David Wood wrote: > Another point to mention is that DBI->quote looks not only at the value > being inserted, but also to the data_type of the table/field it's going > into, and replaces undef values with an unquoted NULL value, if > appropriate. This is

Re: Think there is something DBI

2001-07-18 Thread David Wood
es_taught,$subjectarea_1,$s > ubjectarea_2,$subjectarea_3,$subjectarea_4,$subjectarea_5,$subjectarea_6,$ho > w_heard,$Occupation)`; > > my $sth= "$SQL_UP"; > $str= $dbh->quote($sth); > print $str; > exit; > - Original Message - > From: "David

Re: Think there is something DBI

2001-07-18 Thread borakovej
ovej" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, July 18, 2001 7:23 AM Subject: Re: Think there is something DBI > DBI has a built in method, DBI->quote; > > eg: > > my $dbh = DBI->connect(...); > > my $str = "Haven't I got

Re: Think there is something DBI

2001-07-18 Thread David Wood
20 odd question marks is not too bad ;) > > Somehow I've had more problems with the $dbh->quote($str) which very well > may be because of my own errors. > > J > > -Original Message- > From: borakovej [mailto:[EMAIL PROTECTED]] > Sent: 18 July 2001 1

RE: Think there is something DBI

2001-07-18 Thread PURMONEN, Joni
om: borakovej [mailto:[EMAIL PROTECTED]] Sent: 18 July 2001 18:04 To: PURMONEN, Joni; [EMAIL PROTECTED] Subject: Re: Think there is something DBI that would work if it where a little insert but this is what the insert looks like $SQL_UP = qq` Insert into $DB_Table (firstname,lastname,title,ph

Re: Think there is something DBI

2001-07-18 Thread David Wood
DBI has a built in method, DBI->quote; eg: my $dbh = DBI->connect(...); my $str = "Haven't I got lot's of badl'y used apostrophy's"; $str = $dbh->quote($str); # $str is now "Haven\'t I got lot\'s of badl\'y used apostrophy\'s" # But it won't sort out intentionally bad English : ) Whi

Re: Think there is something DBI

2001-07-18 Thread borakovej
27;,'$zip2','$inst','$school_type','$ grades_taught','$subjectarea_1','$subjectarea_2','$subjectarea_3','$subjecta rea_4','$subjectarea_5','$subjectarea_6','$how_heard','$Occupation'

RE: Think there is something DBI

2001-07-18 Thread PURMONEN, Joni
about apostrophes in the strings $this or $id. Joni -Original Message- From: borakovej [mailto:[EMAIL PROTECTED]] Sent: 18 July 2001 17:31 To: [EMAIL PROTECTED] Subject: Think there is something DBI OK here is an overview of my problem, I am running a script to take a pipe delimited flat fi

Think there is something DBI

2001-07-18 Thread borakovej
OK here is an overview of my problem, I am running a script to take a pipe delimited flat file and pump the data into a database. Due to the users putting extraneous apostrophes I am getting errors that there are unclosed apostrophes in the fields. I am looking for a way to escape these apostro