use strict; use Win32::ODBC; my $DNSName = <YOURDSNNAMEHERE>; my $insert = new Win32::ODBC("DSN=$DSNName;UID=<DBUSERNAME>;PWD=<P +ASSWORD>") || die "Error: " . Win32::ODBC::Error(); my $sqlstr = "INSERT INTO....<BLAH><BLAH>etc."; if (!$insert->Sql($sqlstr)){ #Do Something }else{ #Figure out the error and do something else }
Of course, you should be typing you question into the super search, which would give you a number answers, including this one that has links to a couple of tutorials (care of crazyinsomniac) Here and here .
I suggest you go to a few of these, read and learn.
UPDATE: I took the time to offer a few links, and add use strict;. I was in a hurry earlier. *sigh* no rest for the wicked.
C-.
In reply to Re: Writing to a DB in Windows Perl
by cacharbe
in thread Writing to a DB in Windows Perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |