Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use DBI;
- $ENV{"ORACLE_HOME"}="/home/oracle/app/oracle/product/11.2.0/dbhome_1";
- $ENV{"NLS_LANG"}="RUSSIAN.CL8KOI8R";
- #my $dbh = DBI->connect("dbi:Oracle:host=hovrino;sid=ORCL", "DAS", "password", {RaiseError=>0,PrintError=>0,AutoCommit=>0})
- # || oraerror('Connect','__EXIT__');
- # $dbh->do("alter session set NLS_NUMERIC_CHARACTERS='.,'");
- my $dbh = DBI->connect('DBI:Pg:dbname=gen','postgres','password') || die $DBI::errstr;
- #my $dbh = DBI->connect('DBI:mysql:nas:localhost','nas','password') || die $DBI::errstr;
- my $sth=$dbh->prepare('insert into repeats values(?,?,?,?)');
- open(my $fl,"<","repeats-g38-201505-nodoppel-chr1.csv");
- my $res;
- while(<$fl>) {
- chomp;
- my @val=split(/,/);
- if(! ($res=$sth->execute(@val))) {
- print "Error $res\n";
- last;
- }
- }
- $dbh->commit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement