
select statement fails
This is a multi-part message in MIME format.
--===============0561264520==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C7EB74.AD92FFF6"
This is a multi-part message in MIME format.
------_=_NextPart_001_01C7EB74.AD92FFF6
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
greetings all,
I think I have a case of too much data being returned to a perl script,
but I'm not certain.
using perl 5, DBI:ODBC, MS-SQL and IIS 6:
executing the following code:
$sth =3D $dbh->prepare("select field1 from table ") || &failed( "prep
failed" );
$exec =3D $sth->execute() || &failed( "exec failed" );
correctly returns 170 rows of data. but if I replace the field name with
*, as in:
$sth =3D $dbh->prepare("select * from table ") || &failed( "prep failed"
);
$exec =3D $sth->execute() || &failed( "exec failed" );
it returns no data, but neither does either statement fail. the table
contains 160 fields.
can the script be overwhelmed with too much data, and/or are there
limits of field counts or return-set size, and if so can they be
managed? I have a hard time believing perl can't handle this table.
any ideas greatly appreciated. thanks.
John DePasquale
IT Manager
Law Offices of James Sokolove
1340 Centre Street - Suite 102
Newton, MA 02459
Direct line: 617-467-6932
Fax: 617-964-4336
This email is intended solely for the use of the individual to whom it
is addressed and may contain information that is privileged,
confidential or otherwise exempt from disclosure under applicable law.
If the reader of this email is not the intended recipient or the
employee or agent responsible for delivering the message to the intended
recipient, you are hereby notified that any dissemination, distribution,
or copying of this communication is strictly prohibited. If you have
received this communication in error, please immediately notify us by
telephone and return the original message to us at the listed email
address. Thank You.
------_=_NextPart_001_01C7EB74.AD92FFF6
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"PostalCode"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"State"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"City"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"Street"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"address"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:"Microsoft Sans Serif";
panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>greetings all,<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I think I have a case of too much data being returned =
to a
perl script, but I’m not certain.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>using perl 5, DBI:<st1:place w:st=3D"on"><st1:City =
w:st=3D"on">ODBC</st1:City>,
<st1:State w:st=3D"on">MS</st1:State></st1:place>-SQL and IIS =
6:<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>executing the following =
code:<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>$sth =3D $dbh->prepare("select field1 from =
table ")
|| &failed( "prep failed" );<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>$exec =3D $sth->execute() || &failed( =
"exec failed"
);<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>correctly returns 170 rows of data. but if I replace =
the
field name with *, as in:<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>$sth =3D $dbh->prepare("select * from table =
") ||
&failed( "prep failed" );<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>$exec =3D $sth->execute() || &failed( =
"exec failed"
);<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>it returns no data, but neither does either statement =
fail.
the table contains 160 fields.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>can the script be overwhelmed with too much data, =
and/or are
there limits of field counts or return-set size, and if so can they be =
managed?
I have a hard time believing perl can’t handle this =
table.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>any ideas greatly appreciated. =
thanks.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><st1:PersonName w:st=3D"on"><font size=3D2 =
color=3Dnavy
face=3D"Times New Roman"><span =
style=3D'font-size:10.0pt;color:navy'>John
DePasquale</span></font></st1:PersonName><font color=3Dnavy><span
style=3D'color:navy'><o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:10.0pt;color:navy'>IT Manager</span></font><font =
color=3Dnavy><span
style=3D'color:navy'><o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:10.0pt;color:navy'>Law Offices of <st1:PersonName =
w:st=3D"on">James
Sokolove</st1:PersonName></span></font><font color=3Dnavy><span
style=3D'color:navy'><o:p></o:p></span></font></p>
<p class=3DMsoNormal><st1:Street w:st=3D"on"><st1:address tabIndex=3D"0"
style=3D"BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: =
url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x"
w:st=3D"on"><font size=3D2 color=3Dnavy face=3D"Times New Roman"><span
style=3D'font-size:10.0pt;color:navy'>1340 Centre =
Street</span></font></st1:address></st1:Street><font
size=3D2 color=3Dnavy><span style=3D'font-size:10.0pt;color:navy'> =
– <st1:address
tabIndex=3D"0"
style=3D"BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: =
url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x"
w:st=3D"on"><st1:Street w:st=3D"on">Suite</st1:Street> =
102</st1:address></span></font><font
color=3Dnavy><span style=3D'color:navy'><o:p></o:p></span></font></p>
<p class=3DMsoNormal><st1:place w:st=3D"on"><st1:City w:st=3D"on"><font =
size=3D2
color=3Dnavy face=3D"Times New Roman"><span =
style=3D'font-size:10.0pt;color:navy'>Newton</span></font></st1:City><fon=
t
size=3D2 color=3Dnavy><span style=3D'font-size:10.0pt;color:navy'>, =
<st1:State
w:st=3D"on">MA</st1:State> <st1:PostalCode =
w:st=3D"on">02459</st1:PostalCode></span></font></st1:place><font
color=3Dnavy><span style=3D'color:navy'><o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:10.0pt;color:navy'>Direct line: =
617-467-6932</span></font><o:p></o:p></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:10.0pt;color:navy'>Fax: =
617-964-4336</span></font><font
color=3Dnavy><span style=3D'color:navy'><o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D1 face=3D"Microsoft Sans Serif"><span
style=3D'font-size:7.5pt;font-family:"Microsoft Sans Serif"'>This email =
is
intended solely for the use of the individual to whom it is addressed =
and may contain
information that is privileged, confidential or otherwise exempt from
disclosure under applicable law. If the reader of this email is not the
intended recipient or the employee or agent responsible for delivering =
the
message to the intended recipient, you are hereby notified that any
dissemination, distribution, or copying of this communication is =
strictly
prohibited. If you have received this communication in error, please
immediately notify us by telephone and return the original message to us =
at the
listed email address. Thank You.</span></font><font size=3D1
face=3D"Microsoft Sans Serif"><span =
style=3D'font-size:7.5pt;font-family:"Microsoft Sans =
Serif"'><o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
------_=_NextPart_001_01C7EB74.AD92FFF6--
--===============0561264520==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0561264520==--
Re: select statement fails
This is a multi-part message in MIME format.
--===============1753459050==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_00A9_01C7EB4C.37742970"
This is a multi-part message in MIME format.
------=_NextPart_000_00A9_01C7EB4C.37742970
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
What are your previous/following lines on that code? I'de like to see it =
more complete in order tyo find possible errors. I've used perl to =
manage really large tables (much larger than yours) with no problem. =
Also, which database/driver are you using?
Paco
----- Original Message -----
From: John DePasquale
To: activeperl [at] listserv.ActiveState.com
Sent: Thursday, August 30, 2007 9:14 PM
Subject: select statement fails
greetings all,
I think I have a case of too much data being returned to a perl =
script, but I'm not certain.
using perl 5, DBI:ODBC, MS-SQL and IIS 6:
executing the following code:
$sth =3D $dbh->prepare("select field1 from table ") || &failed( "prep =
failed" );
$exec =3D $sth->execute() || &failed( "exec failed" );
correctly returns 170 rows of data. but if I replace the field name =
with *, as in:
$sth =3D $dbh->prepare("select * from table ") || &failed( "prep =
failed" );
$exec =3D $sth->execute() || &failed( "exec failed" );
it returns no data, but neither does either statement fail. the table =
contains 160 fields.
can the script be overwhelmed with too much data, and/or are there =
limits of field counts or return-set size, and if so can they be =
managed? I have a hard time believing perl can't handle this table.
any ideas greatly appreciated. thanks.
John DePasquale
IT Manager
Law Offices of James Sokolove
1340 Centre Street - Suite 102
Newton, MA 02459
Direct line: 617-467-6932
Fax: 617-964-4336
This email is intended solely for the use of the individual to whom it =
is addressed and may contain information that is privileged, =
confidential or otherwise exempt from disclosure under applicable law. =
If the reader of this email is not the intended recipient or the =
employee or agent responsible for delivering the message to the intended =
recipient, you are hereby notified that any dissemination, distribution, =
or copying of this communication is strictly prohibited. If you have =
received this communication in error, please immediately notify us by =
telephone and return the original message to us at the listed email =
address. Thank You.
------------------------------------------------------------ -------------=
-----
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
------=_NextPart_000_00A9_01C7EB4C.37742970
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns=3D"http://www.w3.org/TR/REC-html40" xmlns:o =3D
"urn:schemas-microsoft-com:office:office" xmlns:w =3D
"urn:schemas-microsoft-com:office:word" xmlns:st1 =3D
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16525" =
name=3DGENERATOR><o:SmartTagType
name=3D"place"
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTagT=
ype><o:SmartTagType
name=3D"PostalCode"
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTagT=
ype><o:SmartTagType
name=3D"State"
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTagT=
ype><o:SmartTagType
name=3D"City"
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTagT=
ype><o:SmartTagType
name=3D"Street"
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTagT=
ype><o:SmartTagType
name=3D"address"
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTagT=
ype><o:SmartTagType
name=3D"PersonName"
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTagT=
ype><!--[if !mso]>
<STYLE>st1\:* {
BEHAVIOR: url(#default#ieooui)
}
</STYLE>
<![endif]-->
<STYLE>
<!--
/* Font Definitions */
[at] font-face
{font-family:"Microsoft Sans Serif";
panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</STYLE>
</HEAD>
<BODY lang=3DEN-US vLink=3Dpurple link=3Dblue bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>What are your previous/following lines =
on that
code? I'de like to see it more complete in order tyo find possible =
errors. I've
used perl to manage really large tables (much larger than =
yours) with
no problem. Also, which database/driver are you using?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Paco</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<BLOCKQUOTE
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>
<A title=3Djohnd [at] jimsokolove.com =
href=3D"mailto:johnd [at] jimsokolove.com">John
DePasquale</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A
title=3Dactiveperl [at] listserv.ActiveState.com
=
href=3D"mailto:activeperl [at] listserv.ActiveState.com">activepe rl [at] listserv.A=
ctiveState.com</A>
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, August 30, 2007 =
9:14
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> select statement =
fails</DIV>
<DIV><BR></DIV>
<DIV class=3DSection1>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">greetings
all,<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I think I have a case of =
too much
data being returned to a perl script, but I=92m not
certain.<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">using perl 5, =
DBI:<st1:place
w:st=3D"on"><st1:City w:st=3D"on">ODBC</st1:City>, <st1:State
w:st=3D"on">MS</st1:State></st1:place>-SQL and IIS
6:<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">executing the following
code:<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">$sth =3D =
$dbh->prepare("select
field1 from table ") || &failed( "prep failed"
);<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">$exec =3D =
$sth->execute() ||
&failed( "exec failed" );<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">correctly returns 170 =
rows of
data. but if I replace the field name with *, as
in:<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">$sth =3D =
$dbh->prepare("select *
from table ") || &failed( "prep failed" =
);<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">$exec =3D =
$sth->execute() ||
&failed( "exec failed" );<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">it returns no data, but =
neither
does either statement fail. the table contains 160
fields.<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">can the script be =
overwhelmed with
too much data, and/or are there limits of field counts or return-set =
size, and
if so can they be managed? I have a hard time believing perl can=92t =
handle this
table.<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">any ideas greatly =
appreciated.
thanks.<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN
style=3D"FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=3DMsoNormal><st1:PersonName w:st=3D"on"><FONT face=3D"Times =
New Roman"
color=3Dnavy size=3D2><SPAN style=3D"FONT-SIZE: 10pt; COLOR: =
navy">John
DePasquale</SPAN></FONT></st1:PersonName><FONT color=3Dnavy><SPAN
style=3D"COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3D"Times New Roman" color=3Dnavy =
size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; COLOR: navy">IT Manager</SPAN></FONT><FONT
color=3Dnavy><SPAN style=3D"COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3D"Times New Roman" color=3Dnavy =
size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; COLOR: navy">Law Offices of <st1:PersonName
w:st=3D"on">James Sokolove</st1:PersonName></SPAN></FONT><FONT =
color=3Dnavy><SPAN
style=3D"COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><st1:Street w:st=3D"on"><st1:address
style=3D"BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: =
url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x"
tabIndex=3D0 w:st=3D"on"><FONT face=3D"Times New Roman" color=3Dnavy =
size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; COLOR: navy">1340 Centre
Street</SPAN></FONT></st1:address></st1:Street><FONT color=3Dnavy =
size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; COLOR: navy"> =96 <st1:address
style=3D"BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: =
url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x"
tabIndex=3D0 w:st=3D"on"><st1:Street w:st=3D"on">Suite</st1:Street>
102</st1:address></SPAN></FONT><FONT color=3Dnavy><SPAN
style=3D"COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><st1:place w:st=3D"on"><st1:City =
w:st=3D"on"><FONT
face=3D"Times New Roman" color=3Dnavy size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; COLOR: =
navy">Newton</SPAN></FONT></st1:City><FONT
color=3Dnavy size=3D2><SPAN style=3D"FONT-SIZE: 10pt; COLOR: navy">, =
<st1:State
w:st=3D"on">MA</st1:State> <st1:PostalCode
w:st=3D"on">02459</st1:PostalCode></SPAN></FONT></st1:place><FONT
color=3Dnavy><SPAN style=3D"COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3D"Times New Roman" color=3Dnavy =
size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; COLOR: navy">Direct line:
617-467-6932</SPAN></FONT><o:p></o:p></P>
<P class=3DMsoNormal><FONT face=3D"Times New Roman" color=3Dnavy =
size=3D2><SPAN
style=3D"FONT-SIZE: 10pt; COLOR: navy">Fax: =
617-964-4336</SPAN></FONT><FONT
color=3Dnavy><SPAN style=3D"COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3D"Microsoft Sans Serif" =
size=3D1><SPAN
style=3D"FONT-SIZE: 7.5pt; FONT-FAMILY: 'Microsoft Sans Serif'">This =
email is
intended solely for the use of the individual to whom it is addressed =
and may
contain information that is privileged, confidential or otherwise =
exempt from
disclosure under applicable law. If the reader of this email is not =
the
intended recipient or the employee or agent responsible for delivering =
the
message to the intended recipient, you are hereby notified that any
dissemination, distribution, or copying of this communication is =
strictly
prohibited. If you have received this communication in error, please
immediately notify us by telephone and return the original message to =
us at
the listed email address. Thank You.</SPAN></FONT><FONT
face=3D"Microsoft Sans Serif" size=3D1><SPAN
style=3D"FONT-SIZE: 7.5pt; FONT-FAMILY: 'Microsoft Sans =
Serif'"><o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN
style=3D"FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>ActivePerl =
mailing
list<BR>ActivePerl [at] listserv.ActiveState.com<BR>To unsubscribe:
=
http://listserv.ActiveState.com/mailman/mysubs</BLOCKQUOTE></BODY></HTML>=
------=_NextPart_000_00A9_01C7EB4C.37742970--
--===============1753459050==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1753459050==--
RE: select statement fails
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of John
DePasquale
Sent: 31 August 2007 03:15
To: activeperl [at] listserv.ActiveState.com
Subject: select statement fails
> greetings all,
> I think I have a case of too much data being returned to a perl
script, but I'm not certain.
> using perl 5, DBI:ODBC, MS-SQL and IIS 6:
I am guessing you mean DBI and DBD::ODBC.
> =
> executing the following code:
> =
> $sth =3D $dbh->prepare("select field1 from table ") || &failed( "prep
failed" );
> $exec =3D $sth->execute() || &failed( "exec failed" );
> =
> correctly returns 170 rows of data. but if I replace the field name
with *, as in:
> =
> $sth =3D $dbh->prepare("select * from table ") || &failed( "prep failed"
);
> $exec =3D $sth->execute() || &failed( "exec failed" );
> =
> it returns no data, but neither does either statement fail. the table
contains 160 fields.
> =
> can the script be overwhelmed with too much data, and/or are there
limits of field counts or return-set size, =
> and if so can they be managed? I have a hard time believing perl can't
handle this table.
> any ideas greatly appreciated. thanks.
Firstly, colour me clueless with regard to ODBC, MS_SQL and IIS, but I
have some experience of DBI.
You don't really provide enough information, but the database driver
(DBD::ODBC in this case) should be capable of fetching enormous amounts
of data from the database if you use if intelligently, i.e. don't try to
fetch everything in one go. Certainly much more than 170 rows of 160
fields (if that is what you mean) so your problem is likely to be
elsewhere, probably in the code that you haven't shown us.
In the mean time, I have a couple of suggestions.
I prefer in general to use the RaiseError attribute on the database
connection which makes for cleaner code (IMO), and often less typing as
you don't need to explicitly check every DBI call, which I like. For
example my typical prepare/execute/fetch code looks something like this
(just typed from memory, not from real code):
eval {
my $sth =3D $dbh->prepare(qq{select * from table});
$sth->execute;
while (my $rowref =3D $sth->fetch) {
...
}
};
die $ [at] if S [at] ;
Also, it is better not to prefix subroutine calls with '&', unless a)
you know what it does, and b) you actually need that functionality. Its
less typing as well, which I like, as I think I mentioned :-).
Can I also reiterate Jan Dubois' request to post in plain text, as it
makes it easier (certainly for me) to reply.
HTH
-- =
Brian Raven =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Atos Euronext Market Solutions Disclaimer
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
The information contained in this e-mail is confidential and solely for the=
intended addressee(s). Unauthorised reproduction, disclosure, modification=
, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediat=
ely and delete it from your system. The views expressed in this message do =
not necessarily reflect those of Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =
Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.
L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.
Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: select statement fails
On Fri, 31 Aug 2007, Brian Raven wrote:
> [mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of John
> DePasquale
> > greetings all,
> > I think I have a case of too much data being returned to a perl
> script, but I'm not certain.
> > using perl 5, DBI:ODBC, MS-SQL and IIS 6:
>
> I am guessing you mean DBI and DBD::ODBC.
>
> > executing the following code:
> >
> > $sth = $dbh->prepare("select field1 from table ") || &failed( "prep
> failed" );
> > $exec = $sth->execute() || &failed( "exec failed" );
> >
> > correctly returns 170 rows of data. but if I replace the field name
> with *, as in:
> >
> > $sth = $dbh->prepare("select * from table ") || &failed( "prep failed"
> );
> > $exec = $sth->execute() || &failed( "exec failed" );
> >
> > it returns no data, but neither does either statement fail. the table
> contains 160 fields.
> > can the script be overwhelmed with too much data, and/or are there
> limits of field counts or return-set size,
> > and if so can they be managed? I have a hard time believing perl can't
> handle this table.
> > any ideas greatly appreciated. thanks.
You can run into problems with blobs, large columns, and truncation of
fields.
This tutorial of DBD::ODBC has a good explanation.
<http://www.easysoft.com/developer/languages/perl/dbd_odbc_tutorial_part_2.html>
If you retrieve a field with more than LongReadLen bytes (defaults to 80
bytes) and LongTruncOk is false (default), then you will get errors. My
recollection is that you would get these errors even if warnings are
turned off, but my memory may be faulty. RaiseError and PrintError (see
below) to see what is going on.
Since you are selecting *, you may be getting fields that contain > 80
bytes of data. If you don't mind truncation, then you can set
$dbh->{LongTruncOk} = 1;
This might not be your problem - best advice is what Brian already
recommended, which is to RaiseError. I pasted Tim Bunce's explanation of
why also using PrintError is a good idea (see below).
> Firstly, colour me clueless with regard to ODBC, MS_SQL and IIS, but I
> have some experience of DBI.
>
> You don't really provide enough information, but the database driver
> (DBD::ODBC in this case) should be capable of fetching enormous amounts
> of data from the database if you use if intelligently, i.e. don't try to
> fetch everything in one go. Certainly much more than 170 rows of 160
> fields (if that is what you mean) so your problem is likely to be
> elsewhere, probably in the code that you haven't shown us.
>
> In the mean time, I have a couple of suggestions.
>
> I prefer in general to use the RaiseError attribute on the database
> connection which makes for cleaner code (IMO), and often less typing as
> you don't need to explicitly check every DBI call, which I like. For
> example my typical prepare/execute/fetch code looks something like this
> (just typed from memory, not from real code):
Pasting an interesting exchange from dbi-users, where Tim Bunce (DBI
creator) explaiend why he recommends using both PrintError and RaiseError.
This is relevant, given Brian's example.
>Tim Bunce
>>Bart Lateur
>> I've always wondered, and now seems a good time to ask as any: why are
>> PrintError and RaiseError not mutually exclusive? It seems silly to
>> have
>> both on at the same time, essentially printing the error message twice.
>> (Yes I've tested it with a fairly recent version of DBI: 1.52).
>
>The exception may be caught by an eval { }.
>Using PrintError you'd still get a warning.
And back to Brian Raven:
> eval {
> my $sth = $dbh->prepare(qq{select * from table});
> $sth->execute;
> while (my $rowref = $sth->fetch) {
> ...
> }
> };
> die $ [at] if S [at] ;
>
> Can I also reiterate Jan Dubois' request to post in plain text, as it
> makes it easier (certainly for me) to reply.
Agreed.
> HTH
>
> --
> Brian Raven
John Costello
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs