#! /usr/oracle/bin/oraperl

$ENV{'ORACLE_HOME'}='/usr/oracle';
$ENV{'ORACLE_SID'}='nodb';

$lda = &ora_login('','michal','michal');
print ("I logged on Oracle lda = $lda\n");
# first find out how many servers there are.
&ora_version();


print ("Now I'll query the database \n");
$query = " select distinct server from clip  ";
print ("$query\n");
$csr= &ora_open($lda, $query) || die "$ora_errstr";;

print ("cursor =$csr\n");

$nfields = (&ora_fetch($csr, 1) );

print ("Returned $nfields field(s) \n");

while (@ser = &ora_fetch($csr))
{
    
    print (" @ser \n");
}

foreach (@ser)
{
    print ( "server: $_  \n");
}
&ora_close($csr);
&ora_logoff($lda);
