MLUG: RE: [MLUG - DISCUSSION] Perl/Oracle question
RE: [MLUG - DISCUSSION] Perl/Oracle question
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Does the query work if you enter it manually? Do you have your settings
set for the proper permissions to access the table?

"Don't sweat it -- it's not real life.  It's only ones and zeroes."
               -- spaf (1988?)

*^*^*^*
Michael McGlothlin <EMAIL:PROTECTED>
http://mlug.missouri.edu/~mogmios/projects/

On Thu, 3 Jan 2002, Ross, Matt wrote:

> I like perl, it's the DBD module that bugs me.
> Anyway, yes the table exists, yes the fields exist, and yes, there's data in
> them.
> 
> > -----Original Message-----
> > From: Michael [mailto:EMAIL:PROTECTED]
> > Sent: Thursday, January 03, 2002 5:56 PM
> > To: EMAIL:PROTECTED
> > Subject: Re: [MLUG - DISCUSSION] Perl/Oracle question
> > 
> > 
> > Obvious first question. Do you have a table or view by that name? ;)
> > 
> > (I think this example proves why Perl is the spawn of the devil though
> > I've seen much much worse.. it's pretty good for Perl. *G*)
> > 
> > > Ok, you asked for it!
> > > 
> > > {> {> {> {> {> {> 
> > > (ASCII pizza slices)
> > > ******************************
> > > Error Log:
> > > [Thu Jan 03 17:28:31 2002] [error] [client 168.166.168.104] 
> > DBD::Oracle::db
> > > prepare failed: ORA-00942: table or view does not exist 
> > (DBD: error possibly
> > > near <*> indicator at char 36 in 'SELECT distinct idnumber
> > > [Thu Jan 03 17:28:31 2002] [error] [client 168.166.168.104] 
> >      FROM
> > > <*>cms_lq_link
> > > [Thu Jan 03 17:28:31 2002] [error] [client 168.166.168.104] 
> >      WHERE
> > > qnumber = :QTYPE
> > > [Thu Jan 03 17:28:31 2002] [error] [client 168.166.168.104] 
> >      AND answer
> > > = :ATYPE
> > > [Thu Jan 03 17:28:31 2002] [error] [client 168.166.168.104]    ') at
> > > d:\indigo\htdocs\demo2\NCDB_Q~4.PL line 146.
> > > 
> > > *************
> > > Perl:
> > > 
> > > #!perl -w
> > > 
> > > $|=1;
> > > 
> > > use CGI;
> > > use DBI;
> > > use strict;
> > > 
> > > require('OracleConnect.pl');
> > > # ^^^ include file that gives user name and password
> > > 
> > >  my $db  = DBI->connect('dbi:Oracle:', $OracleConnect::sUsername, 
> > > $OracleConnect::sPassword,
> > >            { PrintError => 1,
> > >              RaiseError => 1}) or die "Can't connect to database\n";
> > > 
> > >  my $q = new CGI;
> > >  my $remote_addr = $q->remote_addr;
> > > my @cgiinputs = ('x_quest2', 'x_quest3', 'x_quest4', 
> > 'x_countyid', 'gas',
> > > 'dessert', 'deli', 'liquor', 'milk', 'eggs', 'lottery', 'tobacco',
> > > 'fworks');
> > > my @cginumbers = (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
> > > # $structure $sales $employees $county
> > > #
> > > 
> > x_quest2=neither+retail+nor+wholesale&x_quest3=0&x_quest4=Not+
> > Sure&x_countyi
> > > d=All
> > >  my $x_bus_type = $q->param("x_bus_type");
> > >  my $structure = $q->param("x_quest4");
> > >  my $sales = $q->param("x_quest2");
> > >  my $employees = $q->param("x_quest3");
> > >  my $county = $q->param("x_countyid");
> > > 
> > > my $seegeeeye;
> > > my @seegeei;
> > > my $bus_type;
> > >  my $session_exist = undef;
> > >  my $sth = $db->prepare(
> > >   qq{SELECT distinct btidnumber, businesstype
> > >      FROM   cms_business_type
> > >      WHERE  btidnumber = :BUSTYPE
> > >     });
> > > 
> > > 
> > >  $sth->bind_param(":BUSTYPE", $x_bus_type );
> > >  
> > >   my $qs;
> > >     
> > >  
> > > my $lp = $db->prepare(
> > >  qq{select b.license_or_permit, b.more_info, b.download_form,
> > > b.apply_online, b.l_p_descript, b.more_info_url
> > >  FROM cms_lp_link a, cms_license_permit b
> > >  WHERE a.btidnumber = $x_bus_type
> > >  AND a.idnumber = b.idnumber
> > >  });
> > > 
> > > my $lpx;
> > >  
> > > # $lp->bind_param(":BUSTYPE", $x_bus_type );         
> > >  
> > >  $sth->execute();
> > >    while (my @row = $sth->fetchrow_array) {
> > >    $bus_type = $row[1];
> > >    }
> > > 
> > >   
> > >  print $q->header;
> > >  print '<HTML><HEAD><TITLE>MBAC - Start A Business Wizard -
> > > Answers</TITLE><LINK rel="Stylesheet"
> > > HREF="http://images.ded.state.mo.us/css/cms.css" media="screen"
> > > type="text/css"></HEAD>'."\n";
> > >  print '<BODY BGCOLOR="#FFFFFF">'."\n";
> > >  print '<table border="0"><tr><td>';
> > >  print '<h3>Result of Customer Questionaire</h3><p>';
> > >  
> > > my $resultingstring = "You indicated that you are starting 
> > a $bus_type,
> > > structured as: $structure, that will have $sales sales, 
> > will have $employees
> > > employees and will be located in $county County\(s\), Missouri.";
> > > 
> > >  if (defined $x_bus_type){
> > > print '<FORM ACTION="ncdb_question2.secondset.pl" METHOD="get">';
> > > print "<INPUT TYPE=\"hidden\" NAME=\"x_bus_type\" 
> > VALUE=\"$x_bus_type\">";
> > > print '<TABLE  border="0"><TR>';
> > > 
> > > print <<"TheEND";
> > > <table border=0><tr><TD valign=\"top\">
> > > <BR>
> > > <TABLE  border=\"0\">
> > > <TR>
> > > <td>
> > > $resultingstring
> > > <br>The following information is based on that information. 
> > <p>The license
> > > and permit requirements are:</td>
> > > </TR>
> > > <TR>
> > > <td>
> > > <TABLE  border=\"1\" width=\"100%\">
> > > <TR>
> > > <TD VALIGN=\"TOP\"><B><P ALIGN=\"CENTER\">License or Permit
> > > Requirement</B></TD><TD VALIGN=\"TOP\"><B><P 
> > ALIGN=\"CENTER\">Tell Me
> > > More</B></TD><TD VALIGN=\"TOP\"><B><P 
> > ALIGN=\"CENTER\">Download</P><P
> > > ALIGN=\"CENTER\">Form</B></TD><TD VALIGN=\"TOP\"><B><P
> > > ALIGN=\"CENTER\">Apply On Line</B></TD>
> > > </TR>
> > > TheEND
> > > 
> > >   $lp->execute();
> > > 
> > >     while (my @lprow = $lp->fetchrow_array) {
> > > print <<"EndOfTheWorld";
> > > <TR>
> > > <TD VALIGN=\"TOP\">
> > > $lprow[0]
> > > <br>
> > > $lprow[4]
> > > </TD>
> > > <TD VALIGN=\"TOP\">
> > > EndOfTheWorld
> > > 
> > > if ($lprow[5] eq 'NA') {
> > > print "Online Form: NA";
> > > }
> > > else {
> > > print "<A HREF=\"$lprow[5]\" align=\"center\"><img
> > > src=\"http://www.ecodev.state.mo.us/mbac/demo/infolgo.gif\"
> > > border=\"0\"></A>";
> > > }
> > > 
> > > print <<"EndOfTheWorld";
> > > <br>$lprow[1]
> > > </TD>
> > > <TD VALIGN=\"TOP\">
> > > EndOfTheWorld
> > > 
> > > if ($lprow[2] eq 'NA') {
> > > print "Online Form: NA";
> > > }
> > > else {
> > > print "<A HREF=\"$lprow[2]\" align=\"center\"><img
> > > src=\"http://www.ecodev.state.mo.us/mbac/demo/formlgo.gif\"
> > > border=\"0\"></A>";
> > > }
> > > 
> > > print <<"EndOfTheWorld";
> > > </TD>
> > > <TD VALIGN=\"TOP\">
> > > EndOfTheWorld
> > > 
> > > if ($lprow[3] eq 'NA') {
> > > print "Online Form: NA";
> > > }
> > > else {
> > > print "<A HREF=\"$lprow[3]\" align=\"center\"><img
> > > src=\"http://www.ecodev.state.mo.us/mbac/demo/formlgo.gif\"
> > > border=\"0\"></A>";
> > > }
> > > 
> > > print <<"EndOfTheWorld";
> > > </TD>
> > > </TR>
> > > EndOfTheWorld
> > > }
> > > 
> > > #
> > > # Trouble begins below...
> > > #
> > > 
> > > $seegeeeye = 0;
> > > while ($seegeeeye < 13) {
> > > 	print '???'.$cginumbers[$seegeeeye].'
> > > ???'.$q->param($cgiinputs[$seegeeeye]);
> > >   $qs = $db->prepare(
> > >    qq{SELECT distinct idnumber
> > >      FROM cms_lq_link
> > >      WHERE qnumber = :QTYPE
> > >      AND answer = :ATYPE
> > >    });
> > > # see, there be the prob...
> > > 
> > >  $qs->bind_param(":QTYPE", $cginumbers[$seegeeeye] );
> > >  $qs->bind_param(":ATYPE", $q->param($cgiinputs[$seegeeeye]) );
> > >  
> > > $qs->execute();
> > > while (@seegeei = $qs->fetchrow_array) {
> > > $lpx = $db->prepare(
> > >  qq{select license_or_permit, more_info, download_form, 
> > apply_online,
> > > l_p_descript, more_info_url
> > >  FROM cms_license_permit b
> > >  WHERE :IDNUM = idnumber
> > > });
> > >  $lpx->bind_param(":IDNUM", $seegeei[0] );
> > > $lpx->execute();
> > >     while (my @lpxrow = $lpx->fetchrow_array) {
> > > print <<"EndOfTheWorld";
> > > <TR>
> > > <TD VALIGN=\"TOP\">
> > > $lpxrow[0]
> > > <br>
> > > $lpxrow[4]
> > > </TD>
> > > <TD VALIGN=\"TOP\">
> > > EndOfTheWorld
> > > 
> > > if ($lpxrow[5] eq 'NA') {
> > > print "Online Form: NA";
> > > }
> > > else {
> > > print "<A HREF=\"$lpxrow[5]\" align=\"center\"><img
> > > src=\"http://www.ecodev.state.mo.us/mbac/demo/infolgo.gif\"
> > > border=\"0\"></A>";
> > > }
> > > 
> > > print <<"EndOfTheWorld";
> > > <br>$lpxrow[1]
> > > </TD>
> > > <TD VALIGN=\"TOP\">
> > > EndOfTheWorld
> > > 
> > > if ($lpxrow[2] eq 'NA') {
> > > print "Online Form: NA";
> > > }
> > > else {
> > > print "<A HREF=\"$lpxrow[2]\" align=\"center\"><img
> > > src=\"http://www.ecodev.state.mo.us/mbac/demo/formlgo.gif\"
> > > border=\"0\"></A>";
> > > }
> > > 
> > > print <<"EndOfTheWorld";
> > > </TD>
> > > <TD VALIGN=\"TOP\">
> > > EndOfTheWorld
> > > 
> > > if ($lpxrow[3] eq 'NA') {
> > > print "Online Form: NA";
> > > }
> > > else {
> > > print "<A HREF=\"$lpxrow[3]\" align=\"center\"><img
> > > src=\"http://www.ecodev.state.mo.us/mbac/demo/formlgo.gif\"
> > > border=\"0\"></A>";
> > > }
> > > 
> > > print <<"EndOfTheWorld";
> > > </TD>
> > > </TR>
> > > EndOfTheWorld
> > > }
> > > }
> > > $seegeeeye += 1;
> > >  }
> > > # asefdsafasdf
> > > 
> > > print <<"TheEnd";
> > > </TABLE>
> > > </td>
> > > </TR>
> > > <TR>
> > > <td>
> > > <B><P>In addition to information on the legal requirements, 
> > we think that
> > > you?ll find the following information helpful as you begin your
> > > business:</P><P>Industry reports  <A
> > > 
> > HREF=\"http://www.umr.edu/~tscsbdc/\">http://www.umr.edu/~tscs
> > bdc/</A></P><P
> > > >Evaluating Your Business Idea <A
> > > 
> > HREF=\"http://www.umsl.edu/~smallbus/Evalbus.pdf\">http://www.
> > umsl.edu/~smal
> > > lbus/Evalbus.pdf</A></P><P>&quot;Starting A New Business In 
> > Missouri&quot;
> > > (38 pages).  Designed for the beginning business owner, 
> > this highly regarded
> > > publication covers considerations before starting a 
> > business, writing a
> > > business plan and requirements to do business in Missouri.  <A
> > > 
> > HREF=\"http://www.ecodev.state.mo.us/mbac/pdfs/startuppacket.p
> > df\">http://ww
> > > 
> > w.ecodev.state.mo.us/mbac/pdfs/startuppacket.pdf</A></P><P>Gui
> > de to Writing
> > > A Business Plan <A
> > > 
> > HREF=\"http://www.umsl.edu/~smallbus/BusplanG/BusplanG.pdf\">h
> > ttp://www.umsl
> > > .edu/~smallbus/BusplanG/BusplanG.pdf</A></p><p>For 
> > Information on your
> > > County, consult the <a
> > > 
> > href=\"http://mosl.sos.state.mo.us/moinfo/co-offl1.html\">Miss
> > our County
> > > Officials Listing</a></P><hr><a href=\"index.htm\"
> > > style=\"text-align:center\">Main</a><hr>For more 
> > information on starting and
> > > operating your Missouri business or to speak with a 
> > business counselor,
> > > contact:<p>&nbsp;</p><div align=\"center\">Missouri 
> > Business Assistance
> > > Center<br>P.O. Box 118<br>Jefferson City, Missouri  65102<br>Phone:
> > > 573/751-2863<br>Fax: 573/526-2416<br>E-mail: <a
> > > 
> > href=\\"mailto:mbac\@mail.state.mo.us\\">mbac\@mail.state.mo.u
> > s</a><br>Web:
> > > <a
> > > 
> > href=\"http://www.ecodev.state.mo.us/mbac\">http://www.ecodev.
> > state.mo.us/mb
> > > ac</a></div>
> > > </td>
> > > </TR>
> > > </TD>
> > > </TR>
> > > </TABLE>
> > > 
> > > TheEnd
> > > 
> > >  }else{
> > >    print "<a href=\"index.html\">Error, nothing 
> > submitted!</a><br>\n";
> > >  }
> > >  print "\n<hr></td></tr></table>\n";
> > >  print $q->end_html;
> > >  $db->disconnect;
> > > 
> > > exit 0;
> > > --
> > > To unsubscribe, go to http://mlug.missouri.edu/members/edit.php
> > > 
> > > Archives are available at http://mlug.missouri.edu/list-archives/
> > > 
> > 
> > --
> > To unsubscribe, go to http://mlug.missouri.edu/members/edit.php
> > 
> > Archives are available at http://mlug.missouri.edu/list-archives/
> > 
> --
> To unsubscribe, go to http://mlug.missouri.edu/members/edit.php
> 
> Archives are available at http://mlug.missouri.edu/list-archives/
> 

--
To unsubscribe, go to http://mlug.missouri.edu/members/edit.php

Archives are available at http://mlug.missouri.edu/list-archives/