Hello all,

I am trying to retrieve a record that may/maynot have a null value in it.
this is what i am doing, however there its not really working. I can feel
there is a simpler way of doing it, but unfortunately i am clueless in that
sense. Can anybody make sense out of it???

Thanx a lot.

PS: These retrieve only if there is something in DB. However If there is
nothing in it, i want it to have a value NONE.

$sql="SELECT ISS_ID FROM FT_T_ISID WHERE INSTR_ID='$instr_id'
                AND ID_CTXT_TYP='CUSIP' AND END_TMS IS NULL";

        my $cusip_ref = $dbh->selectall_arrayref($sql);
          foreach  my $rec(@$cusip_ref){
            $cusip=(defined $rec->[0])?$rec->[0]:"NONE";
            last;       }

other way (doesnt work either):

$sql="SELECT ISS_ID FROM FT_T_ISID WHERE INSTR_ID='$instr_id'
              AND ID_CTXT_TYP='ISIN' AND LAST_CHG_TMS IS NULL";

        $sth = $dbh->prepare($sql) or die "Can execute query $DBI::errstr";
        $sth->execute;
        while (@row_cusip_isin = $sth->fetchrow_array) {    
                 $isin=(defined
$row_cusip_isin[0])?$row_cusip_isin[0]:"NONE";
           last; }
Daniel Rozengurtel
Analyst II -Data Mining/WHSE 
IT Clearing-Settlements
Banc of America Securities, LLC
9 West 57th Street, 18th Floor, NYC
Email: [EMAIL PROTECTED]
Phone: (212) 847-6253
                        



_____________________________________________________________________ 
IMPORTANT NOTICES: 
          This message is intended only for the addressee. Please notify the
sender by e-mail if you are not the intended recipient. If you are not the
intended recipient, you may not copy, disclose, or distribute this message
or its contents to any other person and any such actions may be unlawful.

         Banc of America Securities LLC("BAS") does not accept time
sensitive, action-oriented messages or transaction orders, including orders
to purchase or sell securities, via e-mail.

         BAS reserves the right to monitor and review the content of all
messages sent to or from this e-mail address. Messages sent to or from this
e-mail address may be stored on the BAS e-mail system.


Reply via email to