first cut of merge of STABLE-pre1_0 into HEAD. I won't even guarantee that it
[mir.git] / dbscripts / conversion / mir_oid.pl
1 #!/usr/bin/perl -w
2 use Pg;
3
4 #if (!defined($ARGV[0])) {
5 #        print "Usage: $0 name_of_filelist_file\n";
6 #        exit 1;
7 #}
8
9 #$dump="$ARGV[0]";
10
11 my $conn = Pg::connectdb("dbname=indy3 user=postgres 
12 host=localhost");
13 ( PGRES_CONNECTION_OK eq $conn->status )
14     and print "Pg::connectdb ........... ok\n"
15     or  die   "Pg::connectdb ........... not ok: ", $conn->errorMessage;
16
17
18     #open(DUMP,"$dump") || die "can't open dump file $dump";
19
20     #$basedir="/cdrom";
21
22 Pg::doQuery($conn, "select content_data from content", \@ary);
23
24 for $i ( 0 .. $#ary ) {
25     for $j ( 0 .. $#{$ary[$i]} ) {
26         print "$ary[$i][$j]\t";
27     }
28     print "\n";
29 }
30
31 #while(<DUMP>) {
32 #        chomp;
33 #        next if (/^$/ || /^\s*$/);
34 #
35 #               # exception liste einlesen...
36 #
37 #
38 #                               # hier insert:
39 #
40 #                               $conn->exec("BEGIN");
41 #                               $oid= $conn->lo_import("$filename");
42 #                               print $conn->errorMessage."\n";
43 #                               print "trying to insert icon\n";
44 #                               $ioid= $conn->lo_import("/tmp/iconblob.jpg");
45 #                               print $conn->errorMessage."\n";
46 #                               $sql="INSERT INTO images 
47 #(title,date,place,author,to_img_layout,to_img_type,is_classified,to_media_f
48 #older,to_img_color,comment,webdb_create,img_width,img_height,image_data,ico
49 #n_data) ".
50 #                                        "VALUES ('".$titel."','20010108','".$ort.
51 #                                        "','Hoch die Kampf 
52 #dem','".$layout."','1','0','2','2','".$comment."',now(),'".$img_width."','"
53 #.$img_height.
54 #                                        "','".$oid."','".$ioid."')";
55 #                               print $sql."\n";
56 #                               $conn->exec( $sql );
57 #                               print $conn->errorMessage."\n";
58 #                               $conn->exec("END");
59 #
60 #
61 #
62 #}
63 ## end of while
64 #
65
66
67