[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgi-list
Subject:    
From:       owner-cgi-list () jann ! com
Date:       1998-11-25 0:59:17
[Download RAW message or body]

QAA28496; Tue, 24 Nov 1998 16:36:45 -0800 (PST)
Message-Id: <199811250036.QAA28496@jann.com>
X-Authentication-Warning: jann.com: Host mg136-127.ricochet.net [204.179.136.127] claimed to be
[204.179.136.127]
X-Mailer: Microsoft Outlook Express for Macintosh - 4.01 (295) 
Date: Tue, 24 Nov 1998 16:37:28 -0800
Subject: [CGI] max length for a "prepare" statement using DBI and MSQL?
From: "Jann Linder" <jann@jann.com>
To: cgi-list@jann.com
Mime-version: 1.0
X-Priority: 3
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
Sender: owner-cgi-list@jann.com
Precedence: bulk

Anyone know the max length for a prepare statement using DBI's MSQL engine?

I am trying to enter records and (AFTER THE PREPARE PORTION), my statement contains a ! followed by
a newline.

here is my routine:

 $sqlstr=qq{INSERT INTO $table_name ($fields) VALUES ($values)};
 
 $sth = $dbh ->prepare($sqlstr);
 

## HERE IS WHERE I FIND THAT $sqlstr now has a ! and newline in it...see below.

# the program DOES ENTER the record...but altered, not the way it was built.

 if (!$sth->execute) {
  print "ERROR: INSERT" .$sth->errstr."\n$sqlstr\n";
  die "ERROR: INSERT" .$sth->errstr."\n$sqlstr\n";
  }
 $sth->finish;
 $dbh->disconnect;


here is what I get when i dump the SQLSTR variable:
BEGIN--

INSERT INTO einsteins
(shopper_number,email,assignment_number,location,address,city,state,shop_date,shop_day,time_in,purc
hase_amount,time_of_day,order_taker_name,order_taker_sex,order_taker_shirt_type,order_taker_shirt_c
olor,order_taker_hat_color,order_taker_other,cashier_name,cashier_sex,cashier_shirt_type,cashier_sh
irt_color,cashier_hat_color,cashier_other,food,q1,q2,q3,q4,q5,q6,q7,q8,q9,q10,notes_q10a,notes_q10b
,notes_q10c,q11,q12,q13,q14,q15,q16,q17,q18,end1,notes_end1,end2,notes_end2,end3,notes_end3,comment
s) VALUES ('99999', 'jkghfjhfgjfh', 'hjkgfghjgf', 'jkhgjkhtgjk', 'hjgfhjgfhjfhj',
'jkhggfjhgfhjfgjhg', 'st', '11-18-1998', 'Wednesday', '12:00', '10', '2', 'kjhgjk', 'M', '1',
'kgjh', 'hjgfhj', 'hjgfhjg1', 'jkhfgjkhgf', 'M', '1', '', '', '',
'jkhgkjhgkjhgkjhgjkhgkjgjkgkjgjkgjkgjkgkjgjkgkjgjkghkjgkjgjkh', '6', '10', '10', '2', '2', '2',
'4', '4', '4', '6', '5', '4', '45', '4', '6', '10', '6', '3', '3', '3', '3', '4', '', '4', '', '4',
'', 'gjkhlgjkhkjhgjgjkhgjhgkjgkjgjkg!
jkhgjhgjkgjkgkjgkjgkjgjghkjhgjkhgjkhgjkhgjkgkjhgkgkgkjhgkjgkjgjkgkjgkjgkjgjkhggkjhsxxfdhgcvhsxzscvg
jnewsxgukw3s4jmiko3weimok') 
END--

SEE the ! and newline in the last field?

It appears randomly...doesn't seem to matter how many characters the variable $value (see the code)
has...

HLP!



Jann Linder
Web Developer
Perl Programmer

Personal Site: http://www.jann.com/
CalendarPlus Site: http://www.calendarplus.com/

-----------------------------------------------------------------
To unsubscribe, send mail to "majordomo@jann.com" with "unsubscribe cgi-list"
in the body.

The CGI Tips & Tricks website (and archive of the list) is located
at http://www.jann.com/Perl/

cgi-list is hosted by Summit Communication Design (http://www.summitdesign.net).

Summit Communication Design is a full-service web hosting firm
providing web design, cgi programming and inter/intra-net support.
-----------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic