PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Rob Truban <rtruban at erols dot com>
Subject: Linux and conversion from DBlib to CTlib
Date: Mar 11 1998 11:16PM

I made the following script on a Solaris Box and I now have CTlib up and
running (I think!) on a Linux Box.  I wanted to know what the equivilent
CT functions are to get the same functionality.  I'm sending my original
DBlib version and not my hacked up CT version.



****************************************************************
#!/apps/perl/perl5

use Sybase::DBlib;

use Getopt::Long;

$dbh = new Sybase::DBlib 'my_id', 'my_passwd', $server;

$dbh->dbcmd("select oidc = oidclass, oidi = oidinst, Circ_name = name,
domain = domain,
Op_State = operationalState, Admin_State = administrativeState,
AssetDescclass = assetDescNameclass, AssetDescinst = assetDescNameinst,
Container = containerNamesString,
reqCirc = reqCircuitNamename, aEndClass = aEndpointNameclass,
aEndinst = aEndpointNameinst, aBW = aBandwidthValue,
zEndclass = zEndpointNameclass, zEndinst = zEndpointNameinst,
zBW = zBandwidthValue, circMode = circuitMode,
Xmitdirection = transmissionDirection, containType = containmentType,
circGroupclass = circuitGroupNameclass,
circGroupinst = circuitGroupNameinst, parentclass = parentNameclass,
parentname = parentNamename,
parentinst = parentNameinst, capT = capacityTotal,
capA = capacityAvail, capR = capacityReserved
from nmccCircuitMOTable\n");

$dbh->dbsqlexec;

$dbh->dbresults;

my $output = "circuit_table.txt";

open (OUTPUT, ">>$output")|| die "Could not open file $output : $!\n";

while(%dat = $dbh->dbnextrow(1))

{

  print OUTPUT "$.$dat{oidc}% $dat{oidi}% $dat{Circ_name}% $dat{domain}%
$dat{Op_State}% $dat{Admin_State}% $dat{AssetDescclass}%
$dat{AssetDescinst}% $dat{Container}% $dat{reqCirc}% $dat{aEndclass}%
$dat{aEndinst}% $dat{aBW}% $dat{zEndclass}% $dat{aEndinst}% $dat{zBW}%
$dat{circMode}% $dat{Xmitdirection}% $dat{containType}%
$dat{circGroupclass}% $dat{circGroupinst}% $dat{parentclass}%
$dat{parentinst}% $dat{parentname}% $dat{capT}% $dat{capA}% $dat{capA}%
$dat{capR} \n";


}

****************************************************************



Any help would be appreciated!!

Thanks,

Rob Truban