<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o = 
"urn:schemas-microsoft-com:office:office"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2737.800" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><FONT 
face="Times New Roman" color=#000000 size=3>I’m executing the following Postgis 
SQL command and if I select the spatial object within the distance the command 
works, but I get the following error message in the Postgresql log:</FONT></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><FONT 
color=#000000><SPAN style="mso-tab-count: 1"><FONT face="Times New Roman" 
size=3>            
</FONT></SPAN><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">ERROR:<SPAN 
style="mso-spacerun: yes">  </SPAN>cursor "mycursor" does not 
exist<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" 
color=#000000 size=3>When I select the spatial object out side the command fails 
and I get the following in the Postgresql log file.</FONT></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>ERROR:<SPAN style="mso-spacerun: yes">  </SPAN>syntax error 
at or near ")" at character 144<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>LOG:<SPAN style="mso-spacerun: yes">  </SPAN>could not send 
data to client: Connection reset by peer<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>LOG:<SPAN style="mso-spacerun: yes">  </SPAN>could not send 
data to client: Broken pipe<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>LOG:<SPAN style="mso-spacerun: yes">  </SPAN>unexpected EOF 
on client connection<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000>The 
Apache log gives me:<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000><SPAN 
style="mso-tab-count: 1">      </SPAN>Premature end of 
script headers:<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT 
face="Times New Roman"><FONT 
color=#000000> <o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT 
face="Times New Roman" size=3>The problem I’m having is that I can’t trap the 
error using an “eval” statement in perl. The </FONT><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">$stmt->execute()is where 
I’m having problems. The command seams to execute OK but when I try 
to <SPAN class=699114617-03082004><FONT face=Arial 
color=#0000ff> <FONT color=#000000>test for $@ or</FONT> 
 </FONT></SPAN>print out $@ or try a ($stmt->fetchrow_array() I get a 
“Premature end of script headers:” error and the program dies with no 
opportunity to trap the error. <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000>Can 
anyone help in showing me a way to trap this error or what I may be doing wrong? 
It appears that “mycusror” is declared in the select statement but maybe lost in 
the execution part. <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN 
style="mso-spacerun: yes"><FONT color=#000000></FONT></SPAN></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT 
face="Times New Roman"><FONT color=#000000>If<SPAN 
style="mso-spacerun: yes">  </SPAN>I copy either SQLcommand<SPAN 
style="mso-spacerun: yes">  </SPAN>and execute it in psql it runs fine. 
With no error messages in the postgresql log file.<SPAN 
style="mso-spacerun: yes">  </SPAN></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT 
face="Times New Roman"><FONT 
color=#000000> <o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" 
color=#000000 size=3>Below is the code snippet</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" 
color=#000000 size=3>++++++++++++++++++++++++++++++++++++++++</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT color=#000000><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">$SQLcommand=qq(</SPAN><FONT 
face="Times New Roman" size=3>SELECT layer, ncpin, mapsheet, ownername, addr1, 
addr2, addr3, city, state, zip, book, page, value, acreage, pflag, revalue, 
market<SPAN style="mso-spacerun: yes">  </SPAN>FROM<SPAN 
style="mso-spacerun: yes">  </SPAN>jccondo WHERE the_geom && 
GeometryFromText('BOX3D(2103178.38307993 558215.2516,2173267.36692007 
611928.4437)',1) AND Distance(GeometryFromText('POINT(2170383.04659743 
579103.715194444)',1),the_geom) < 1401.77967680279);</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT 
face="Times New Roman"><FONT 
color=#000000> <o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" 
color=#000000 size=3>eval {</FONT></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000>my $stmt 
= $dbh->prepare($SQLcommand) ||<SPAN style="mso-spacerun: yes">  
</SPAN>&AppletMsg("The table name doesn't<SPAN 
class=699114617-03082004><FONT face=Arial 
color=#0000ff> </FONT></SPAN>exist or one of the attribute names are not 
valid... $GisDataSrc","error");<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>};<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000>if ($@) 
{<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>&AppletMsg("The table name doesn't exist or one of the 
attribute names are not valid... </FONT><A 
href="mailto:$@%22,%22error">$@","error</A><FONT 
color=#000000>");<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>}<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000>eval 
{<SPAN style="mso-tab-count: 1">      
</SPAN><o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>$stmt->execute() or<SPAN style="mso-spacerun: yes">  
</SPAN>&AppletMsg("Can't execute select items on $GisDataSrc - $DBI::errstr 
","error");<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>};<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000>if ($@) 
{<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>&AppletMsg("Can't execute select items... </FONT><A 
href="mailto:$@%22,%22error">$@","error</A><FONT 
color=#000000>");<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>}<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>$colctr=1;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000><SPAN 
style="mso-tab-count: 1">      
</SPAN><o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000>while 
(@tname = ($stmt->fetchrow_array())) {<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000><SPAN 
style="mso-tab-count: 1">      </SPAN>foreach $value 
(@tname) {<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000><SPAN 
style="mso-tab-count: 2">            
</SPAN>if<SPAN style="mso-spacerun: yes">  </SPAN>($colctr == 
$NumAttrItems+1 ){<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000><SPAN 
style="mso-tab-count: 3">                  
</SPAN>$ItemNum++;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000><SPAN 
style="mso-tab-count: 3">                  
</SPAN>$colctr=1;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000><SPAN 
style="mso-tab-count: 2">            
</SPAN>}<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000><SPAN 
style="mso-tab-count: 2">            
</SPAN>$QueryResultsmatrix[$ItemNum]->[$colctr]=$value<SPAN 
style="mso-tab-count: 5">                         
</SPAN>$colctr++;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000><SPAN 
style="mso-spacerun: yes"> </SPAN><SPAN 
style="mso-tab-count: 1">     
</SPAN>}<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>}<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>$stmt->finish();<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000>++++++++++++++++++++++++++++++++++<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT 
color=#000000> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT color=#000000>I’m 
running the following versions:<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><SPAN 
style="mso-spacerun: yes">    </SPAN>Postgis 
0.8.1</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" 
color=#000000 size=3>    </FONT><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Postgresql 
7.4.1</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" 
color=#000000 size=3>    </FONT><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">DBI    
1.40</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" 
color=#000000 size=3>    </FONT><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Redhat 
9.0</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT 
color=#000000><FONT 
face="Times New Roman"> <o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" 
color=#000000 size=3>Please let me know if I need to provide any other 
information to help debug the program. </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT 
color=#000000><FONT 
face="Times New Roman"> <o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" 
color=#000000 size=3>Thanks in advance for your 
help.</FONT></P></FONT></DIV></BODY></HTML>