File: test1.pl

package info (click to toggle)
ruby-dbi 0.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 596 kB
  • sloc: ruby: 2,800; perl: 12; makefile: 10
file content (39 lines) | stat: -rw-r--r-- 644 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use DBI;

$dbh = DBI->connect("dbi:Oracle:oracle.neumann", "scott", "tiger", {RaiseError => 1, AutoCommit => 0} );


$dbh->do("DROP TABLE MYTEST");
$dbh->do("CREATE TABLE MYTEST (a INT, b VARCHAR2(256), c FLOAT, d VARCHAR2(256))");

$sth = $dbh->prepare("INSERT INTO MYTEST VALUES (:1, :2, :3, :4)");

$i = 1;

while ($i <= 10000) {
  
  $sth->execute($i, "Michael der $i. von Neumann", 5.6 * $i, "HALLO LEUTE WIE GEHTS DENN SO?");
  
  $i = $i + 1;
  #print $i, "\n";
}


$dbh->commit();





#$sth = $dbh->prepare("SELECT * FROM EMP");

#$sth->execute();

#while (@row = $sth->fetchrow_array()) {
#  print(@row);
#}  


$dbh->disconnect();