2
##Read table staStations
if ($mssqldb->Sql("SELECT stationID, security, dockingCostPerVolume, maxShipVolumeDockable, officeRentalCost, operationID, stationTypeID, corporationID, solarSystemID, constellationID, regionID, stationName, reprocessingEfficiency, reprocessingStationsTake, reprocessingHangarFlag
 FROM staStations")) {
    print "SQL Error: " . $mssqldb->Error() . "\n";
    $mssqldb->disconnect;
    exit;
}


# Read table staStations
$count = 0 ;

while ($mssqldb->FetchRow) {
    my ($stationID, $security, $dockingCostPerVolume, $maxShipVolumeDockable, $officeRentalCost, $operationID, $stationTypeID, $corporationID, $solarSystemID, $constellationID, $regionID, $stationName, $reprocessingEfficiency, $reprocessingStationsTake, $reprocessingHangarFlag) = $mssqldb->Data();  ### Get data values from the row
    $stationName =~ s/\'/\'/g;
    $mysqlconnect->do("INSERT INTO staStations(stationID, security, dockingCostPerVolume, maxShipVolumeDockable, officeRentalCost, operationID, stationTypeID, corporationID, solarSystemID, constellationID, regionID, stationName, reprocessingEfficiency, reprocessingStationsTake, reprocessingHangarFlag)
    VALUES ('$stationID', '$security', '$dockingCostPerVolume', '$maxShipVolumeDockable', '$officeRentalCost', '$operationID', '$stationTypeID', '$corporationID', '$solarSystemID', '$constellationID', '$regionID', '$stationName', '$reprocessingEfficiency', '$reprocessingStationsTake', '$reprocessingHangarFlag') ;");
    $count = $count + 1 ;
    print $count . " Rows into staStations \n" ;

}

第一部分工作正常

    if ($mssqldb->Sql("SELECT iconID, iconFile, description FROM eveIcons")) {
    print "SQL Error: " . $mssqldb->Error() . "\n";
    $mssqldb->disconnect;
    exit;
}



# write table eveIcons
foreach ($mssqldb->FetchRow()) {
    my ($iconID, $iconFile, $description) = $mssqldb->Data();  ### Get data values from the row
    $description =~ s/\'/\'/g;
    #$iconFile  =~ s/\_/\_/g;
    print "iconID: " . $iconID . "\n" ;
    print "file: " . $iconFile . "\n" ;
    print "desc: " . $description . "\n \n" ;
    $mysqlconnect->do("INSERT INTO eveIcons(`iconID`, `iconFile`, `description`)
    VALUES ('$iconID', '$iconFile', '$description') ;");
    $count = $count + 1 ;
    print $count . " Rows into eveIcons \n" ;
}

找不到问题,但没有返回任何内容这读取没有数据..

它在我的 MySql 表的第一列中放置一个“0”

MSSQL 表中有 1689 条记录,我在做什么?

4

2 回答 2

1

我在从 mssql 和 LongTruncOk 读取长数据列时遇到了麻烦,LongReadLen 解决了这些问题。

看来您在编写它们时遇到了麻烦。试着看看这篇文章:http: //publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp ?topic=%2Fcom.ibm.db2.udb.apdv.sample.doc%2Fdoc% 2Fperl%2Fs-dtlob-pl.htm

有一些关于如何编写 blob 的示例。尝试将其应用于您的描述字段。

于 2012-10-17T03:21:50.333 回答
0

我不太明白为什么,但是关于 MSSQL 服务器上的描述字段的某些内容试图分配大量内存,一旦我停止尝试复制该列,它就可以正常工作,

MSSQL 表上的更多信息数据类型设置为 VARCHAR(MAX),尽管该列中的所有字段都没有超过 127 个字符

于 2012-10-16T21:37:21.840 回答