Hi perlers,

I have a BLOB text problem, I am attempting to take data out of one DB and
put it into another (both Sybase)
the box I am running it on is Unix, I am having to do this as we have a
firewall zone "DMZ" blocking this in the normal way.

Please could someone help?
this is my error message:
DBD::Sybase::db prepare failed: Server message number=2782 severity=16
state=1 line=2 server=SYB_XIL1 procedure=DBD41c6 text=An untyped variable in
the PREPARE statement 'DBD41c6' is being resolved to a TEXT or IMAGE type.
This is illegal in a dynamic PREPARE statement.
bind_col: column 2 is not a valid column (1..1) at dbitest line 79.

This is my script, running on Unix with sybase. I have sucessfully installed
DBI and DBD::SYBASE.

#!/usr/local/bin/perl
use DBI;
$dbh_sandf = DBI->connect( "DBI:Sybase:SYB_LIVE", "User", "Password" )
or die "can't connect at this time: $DBI::errstr\n";

$dbh_shopper = DBI->connect( "DBI:Sybase:SYB_XIL1", "User", "Password" )
or die "can't connect at this time: $DBI::errstr\n";

$sth_shopper = $dbh_shopper->prepare( "
INSERT CARS
(
Make                    ,
Model                   ,
Price                   ,
TradeSale               ,
TelephoneNo1            ,
TelephoneNo2            ,
AdText                  ,
AdOriginatingDivision   ,
AdPublication           ,
AdBookingNumber         ,
AdBookingDate           ,
Mileage                 ,
RegistrationYear        ,
RegistrationPlate       ,
BasicBodyColour         ,
TrimColour              ,
AntiLockBrakes          ,
AirConditioning         ,
Alarm                   ,
AlloyWheels             ,
Automatic               ,
Convertible             ,
CDPlayer                ,
CentralLocking          ,
CruiseControl           ,
Diesel                  ,
Estate                  ,
ElectricWindows         ,
FullServiceHistory      ,
LeftHandDrive           ,
LeatherTrim             ,
MetallicPaint           ,
OneOwner                ,
PowerAssistedSteering   ,
Stereo                  ,
Sunroof                 ,
Warranty                ,
UniqueRef               ,
FourWheelDrive          ,
BasicBodyColour2        ,
Turbo                   ,
Salvage                 ,
KitCar                  ,
Wanted                  ,
Classic                 ,
American                ,
NNGCode                 ,
AdStatus                ,
CreationDate            ,
ReplacementUniqueRef    ,
PostCode
)
VALUES
(
?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
?,?,?,?,?,?,?,?,?,?,?,?,?
)
       " );

$sth_sandf->execute();

$sth_sandf->bind_col( 1,  \$Make                     );
$sth_sandf->bind_col( 2,  \$Model                   );
$sth_sandf->bind_col( 3,  \$Price                   );
$sth_sandf->bind_col( 4,  \$TradeSale               );
$sth_sandf->bind_col( 5,  \$TelephoneNo1            );
$sth_sandf->bind_col( 6,  \$TelephoneNo2            );
$sth_sandf->bind_col( 7,  \$AdText                  );
$sth_sandf->bind_col( 8,  \$AdOriginatingDivision   );
$sth_sandf->bind_col( 9,  \$AdPublication           );
$sth_sandf->bind_col( 10, \$AdBookingNumber         );
$sth_sandf->bind_col( 11, \$AdBookingDate           );
$sth_sandf->bind_col( 12, \$Mileage                 );
$sth_sandf->bind_col( 13, \$RegistrationYear        );
$sth_sandf->bind_col( 14, \$RegistrationPlate       );
$sth_sandf->bind_col( 15, \$BasicBodyColour         );
$sth_sandf->bind_col( 16, \$TrimColour              );
$sth_sandf->bind_col( 17, \$AntiLockBrakes          );
$sth_sandf->bind_col( 18, \$AirConditioning         );
$sth_sandf->bind_col( 19, \$Alarm                   );
$sth_sandf->bind_col( 20, \$AlloyWheels             );
$sth_sandf->bind_col( 21, \$Automatic               );
$sth_sandf->bind_col( 22, \$Convertible             );
$sth_sandf->bind_col( 23, \$CDPlayer                );
$sth_sandf->bind_col( 24, \$CentralLocking          );
$sth_sandf->bind_col( 25, \$CruiseControl           );
$sth_sandf->bind_col( 26, \$Diesel                  );
$sth_sandf->bind_col( 27, \$Estate                  );
$sth_sandf->bind_col( 28, \$ElectricWindows         );
$sth_sandf->bind_col( 29, \$FullServiceHistory      );
$sth_sandf->bind_col( 30, \$LeftHandDrive           );
$sth_sandf->bind_col( 31, \$LeatherTrim             );
$sth_sandf->bind_col( 32, \$MetallicPaint           );
$sth_sandf->bind_col( 33, \$OneOwner                );
$sth_sandf->bind_col( 34, \$PowerAssistedSteering   );
$sth_sandf->bind_col( 35, \$Stereo                  );
$sth_sandf->bind_col( 36, \$Sunroof                 );
$sth_sandf->bind_col( 37, \$Warranty                );
$sth_sandf->bind_col( 38, \$UniqueRef               );
$sth_sandf->bind_col( 39, \$FourWheelDrive          );
$sth_sandf->bind_col( 40, \$BasicBodyColour2        );
$sth_sandf->bind_col( 41, \$Turbo                   );
$sth_sandf->bind_col( 42, \$Salvage                 );
$sth_sandf->bind_col( 43, \$KitCar                  );
$sth_sandf->bind_col( 44, \$Wanted                  );
$sth_sandf->bind_col( 45, \$Classic                 );
$sth_sandf->bind_col( 46, \$American                );
$sth_sandf->bind_col( 47, \$NNGCode                 );
$sth_sandf->bind_col( 48, \$AdStatus                );
$sth_sandf->bind_col( 49, \$CreationDate            );
$sth_sandf->bind_col( 50, \$ReplacementUniqueRef    );
$sth_sandf->bind_col( 51, \$PostCode                );


##Retrieve the returned rows
while ( $sth_sandf->fetch ) {
             $sth_shopper->execute($Make                    ,
$Model                   ,
$Price                   ,
$TradeSale               ,
$TelephoneNo1            ,
$TelephoneNo2            ,
$AdText                  ,
$AdOriginatingDivision   ,
$AdPublication           ,
$AdBookingNumber         ,
$AdBookingDate           ,
$Mileage                 ,
$RegistrationYear        ,
$RegistrationPlate       ,
$BasicBodyColour         ,
$TrimColour              ,
$AntiLockBrakes          ,
$AirConditioning         ,
$Alarm                   ,
$AlloyWheels             ,
$Automatic               ,
$Convertible             ,
$CDPlayer                ,
$CentralLocking          ,
$CruiseControl           ,
$Diesel                  ,
$Estate                  ,
$ElectricWindows         ,
$FullServiceHistory      ,
$LeftHandDrive           ,
$LeatherTrim             ,
$MetallicPaint           ,
$MetallicPaint           ,
$OneOwner                ,
$PowerAssistedSteering   ,
$Stereo                  ,
$Sunroof                 ,
$Warranty                ,
$UniqueRef               ,
$FourWheelDrive          ,
$BasicBodyColour2        ,
$Turbo                   ,
$Salvage                 ,
$KitCar                  ,
$Wanted                  ,
$Classic                 ,
$American                ,
$NNGCode                 ,
$AdStatus                ,
$CreationDate            ,
$ReplacementUniqueRef    ,
$PostCode
);

}



Thanks for your help.

Paul.

_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to