<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - Database Updates etc with DBI - Comments</title>
 <link>http://community.activestate.com/forum-topic/database-updates-etc-dbi</link>
 <description>Comments for &quot;Database Updates etc with DBI&quot;</description>
 <language>en</language>
<item>
 <title>Database Updates etc with DBI</title>
 <link>http://community.activestate.com/forum-topic/database-updates-etc-dbi</link>
 <description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I am using the following code to read data from a local database, I also want to be able to write to the database, but can&#039;t find any code examples on the internet that work with my current setup, for reasons I would like to only use the DBI module and as such things like &lt;code class=&quot;geshifilter&quot;&gt;DBI-&amp;gt;connect(&#039;string&#039;)&lt;/code&gt; and &lt;code class=&quot;geshifilter&quot;&gt;sth-&amp;gt;execute(&#039;string&#039;)&lt;/code&gt; don&#039;t work with what I have.  So, are the commands like &lt;strong&gt;InsertRow&lt;/strong&gt; that match the command set which contains &lt;code class=&quot;geshifilter&quot;&gt;Connection()&lt;/code&gt; and &lt;code class=&quot;geshifilter&quot;&gt;FetchRow()&lt;/code&gt;?&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;#!C:\Perl\bin\perl.exe -w
use strict;
use CGI &#039;:standard&#039;;
use DBI;

#Set up variables
my $dbName = &quot;testDB&quot;;
my($i, $j, $id, $bg, $data, $SQL);

#Make a connection to the database
use Win32::ODBC;
$data = new Win32::ODBC($dbName);
$data-&amp;gt;Connection();

#Initialise output and HTML tags
print &quot;Content-type:text/html\n\n&quot;;
print &amp;lt;&amp;lt;&quot;htmlHeader&quot;;
htmlHeader

#Output the data
while($data-&amp;gt;FetchRow()){
   my @rowValues=$data-&amp;gt;Data;
   print &quot;$rowValues[1] $rowValues[2] $rowValues[3]&quot;;
}

#Output the HTML end tags
print &amp;lt;&amp;lt;&quot;htmlFooter&quot;;
htmlFooter&lt;/pre&gt;&lt;/p&gt;&lt;/blockquote&gt;
</description>
 <comments>http://community.activestate.com/forum-topic/database-updates-etc-dbi#comments</comments>
 <category domain="http://community.activestate.com/forums/perl-discussion-0">Perl discussion</category>
 <category domain="http://community.activestate.com/os/windows-vista">Windows Vista</category>
 <pubDate>Thu, 06 Mar 2008 02:14:25 -0800</pubDate>
 <dc:creator>maldrac</dc:creator>
 <guid isPermaLink="false">2015 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
