use Win32::AdminMisc;
use Win32::ODBC;
#
# Snip . . . 
#
$DSN = "disk";
if (!($db = new Win32::ODBC($DSN))){
    print "Error connecting to $DSN\n";
    print "Error: " . Win32::ODBC::Error() . "\n";
    exit;
}
#############
# These are just values from the script I use for disk space reporting
#
        $mydate = $fixmo . "/" . $mday. "/" . $yr2;
        $myserver = @Drivearray[0];
        $mydrive = @Drivearray[2];
        $myutil = $Utilpercentage;
        $myused = $Used1;
        $myfree = $Freedb;
        $mytotal = $Total1;


################################################################################
# Populate the DB with the new data.
# 
################################################################################

$SqlStatement = "insert into table (date, server, drive, utilper, used, free, total) 
values ('$mydate','$myserver','$mydrive','$myutil','$myused','$myfree','$mytotal')";
        if ($db->Sql($SqlStatement)){
            print "SQL failed.\n";
            print "Error: " . $db->Error() . "\n";
            $db->Close();
            exit;
        }
}



Hope this helps . . . 


-----Original Message-----
From: Veeraraju_Mareddi [mailto:rajuveera@;satyam.com]
Sent: Monday, October 21, 2002 12:53 PM
To: [EMAIL PROTECTED]
Subject: SQL interface to perl


Hi All ,

I just wanna dump some data to SQL database from my perl script.

How do i do that ? Please send  me any exaples on this

Thaks 
Rajuveera
************************************************************************** 
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to