I don't know how to use db connection for 2 different Sybase servers within the same program.
How can I capture information from 2 different servers. Here is a sample of the actual code.

Thanks for your ideas.

#!/usr/local/bin/perl -w use warnings; use DBD::Sybase; use DBI; sub SQL { my $parm1 = $_[0]; #sql statement my $parm2 = $_[1]; #server my $parm3 = $_[2]; #username my $parm4 = $_[3]; #password my $parm5 = $_[4]; #dbname my $parm6 = $_[5]; #task type my $parm7 = $_[6]; #object_name my ( @data, $data ); <P> </P> my $dbh=DBI->connect("dbi:Sybase:$parm2","$parm3", "$parm4" ) or die D +BI::errstr; $dbh->do("use ${parm5}"); $sth = $dbh->prepare(${parm1}); $sth->execute; while ( @data=$sth->fetchrow_array ) { print "@data\n"; } $sth->finish; $dbh->disconnect(); } ###MAIN#### &SQL("select \@\@servername", "syb_arlu9_new","testman","testman06", " +master"); sleep 10; &SQL("select \@\@servername", "syb_arlu10_new","testman","testman06", +"master");

*****************
** My Results: **
*****************

testSQL.pl syb_arlu9_new syb_arlu9_new

20061201 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips


In reply to database connection output by dreman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.