2016-06-01 13 views
0

blobstorコマンドを使用してjpegイメージをingresデータベースにロードしていますが、これは問題ありません。しかし、ある時点で、私はそれらを再びコピーアウトする手作業を開発する必要があります。Blobstorは反対のコマンド、Ingresを持っていますか?

これはBCPを使用した例ですが、これはSQL Serverデータベースのものです。だから私の質問は、blobstorはIngresのdbから選択するときに使用することができますブロブを抽出するために等しい反対のコマンドを持っていますです。任意の例へのポインタは、非常に高く評価されるだろう。

答えて

1

Ingresに同梱されているBlobstorとは反対のツールがあるとは思えません。私は今のところ解決策が必要なときに、短いプログラムを書いていました。

例として、ここにはperlスクリプトがあります。これはDBIとDBD-IngresIIモジュールを使用します。それはいくつかの使用の希望です。

# Required: db=, table=, col=. Optional: user=. 
    # Anything else is a where clause. 
    use DBI; 
    my %p=(); my $where=""; 
    foreach my $arg (@ARGV) 
    { 
     if ($arg =~ /(db|table|col|user)=(\S+)$/) { $p{$1}=$2; next; } 
     $where .= " ".$arg if($p{db} and $p{table} and $p{col}); 
    } 
    die "db, table and col required.\n" if(!$p{db} or !$p{table} 
     or !$p{col}); 
    my $user=""; $user=$p{user} if defined($p{user}); 
    my $dbh=DBI->connect("dbi:IngresII:".$p{db},$user,""); 
    my $stm="select ".$p{col}." from ".$p{table}; 
    $stm.=" where".$where if ($where ne ""); 
    my $sth=$dbh->prepare($stm); 
    $sth->execute; 
    @row=$sth->fetchrow_array; 
    print $row[0]; 
    $sth->finish; 
    $dbh->disconnect; 
+0

Gジョーンズ、私はこれを試してみてください。 –

関連する問題