Hi everyone,

Could you point out what is wrong the count and the
while loop below?

Here is part of the script:
----------------

$sql_alias = qq( select
  aliasName = l.name
from
  master..syslogins l,
  $eachdb..sysusers u,
  $eachdb..sysalternates a
where
  a.suid = l.suid
  and a.altsuid = u.suid
  and u.name = "dbo"
  order by l.name   );
&sybase_connect("$eachserver",'master',"$sql_alias");
$count = 0;
while( my @aliasdata = $sth->fetchrow_array){
      print "$aliasdata[0]";
      $count_alias = $count++ ;
      if ($count_alias == 0){
print FILE<<EOF
  -------------------------------------
  There is no dbo alias user in $eachdb
  --------------------------------------- 
EOF
;
      }#end if
      else{
print FILE<<EOF
     
-------------------------------------------------
      Alias Name   Aliased User
     
-------------------------------------------------
      $aliasdata[0]  dbo
EOF
;
-----------------------------

########this is the resule of the output file########
# but this is NOT what i want

    --------------------------------------------------
    There is no dbo alias user in FCCSUN26W..cdbs 
    --------------------------------------------------
    -------------------------------------------------
      Alias Name   Aliased User 
    --------------------------------------------------
      jchamber     dbo
    --------------------------------------------------
      Alias Name   Aliased User 
     
-------------------------------------------------
      lnagy       dbo
     
-------------------------------------------------     
Alias Name   Aliased User 
     
-------------------------------------------------
      rvenkata dbo

#### This is what I WANT for the out put
#either print

  -----------------------------------
  there is dbo alias found in this db
  ------------------------------------

### or print

  -------------------------------------------- 
  Alias Name   Aliased User 
  ---------------------------------------------
  jchamber    dbo
  lnagy       dbo
  rvenkata    dbo





__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to