I am relatively new and always trying new things and now I am trying to print 
the output of a select statement to a file.  However I am having issues, the 
print statement just prints the IN file to the outfile and not the results of 
the select statement.  Inserts, deletes, updates etc work fine.  Any 
suggestions?

Thanks

#!/usr/bin/perl -w

#use strict;         #uses strict perl coding rule

use DBI;
use DBD::Sybase;

my $server = 'Development';
my $db = 'mm_dev';
my $file = 'new_objects1.txt';
my $file1 = 'new_objects_sec.txt';
my $table = 'al_sec_window_id';

open IN, "$file";
open OUT, ">>$file1";
select OUT;

while (<IN>) {
    chomp(@_ = split);
    my $dbh = DBI->connect("dbi:Sybase:server=$server", "ghansen", "jshjsh99" )
    or die "Can't Connect:  $DBI::errstr\n";
    
    $dbh->do("use $db");
    
    my $sth = $dbh->prepare( "select *
                            from $table
                            where w_id = '$_[0]'" );

    $sth->execute();
    print "$dbh";

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to