Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Binary search

2 posts in General Discussion Last posting was on 2004-10-01 16:06:58.0Z
Matt Posted on 2004-10-01 05:01:18.0Z
From: "Matt" <nathessATNOSPAMmth.biglobe.ne.jp>
Newsgroups: ianywhere.public.general
Subject: Binary search
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: flh9aab003.wky.mesh.ad.jp
X-Original-NNTP-Posting-Host: flh9aab003.wky.mesh.ad.jp
Message-ID: <415ce49e$1@forums-1-dub>
Date: 30 Sep 2004 22:01:18 -0700
X-Trace: forums-1-dub 1096606878 218.227.163.211 (30 Sep 2004 22:01:18 -0700)
X-Original-Trace: 30 Sep 2004 22:01:18 -0700, flh9aab003.wky.mesh.ad.jp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3665
Article PK: 7567

Can someone give me an example of a binary search?

I have a table called customers and need to do the following
1. Compare previous customers (using a binary search) to the new customer by
a unique index(name,kana,address)
2. If a match is found,
a) delete the current customer,
b) cascade through child tables to change the cust_id from the NEW
value to the OLD value
c) delete the NEW customer entry.

But have not much of an idea of a binary search other than u r basically
halving as u go thru the search to eliminate the list as quickly as
possible?

Thanks

PB9.01


Reg Domaratzki (iAnywhere Solutions) Posted on 2004-10-01 16:06:58.0Z
From: "Reg Domaratzki \(iAnywhere Solutions\)" <Spam_bad_rdomarat@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <415ce49e$1@forums-1-dub>
Subject: Re: Binary search
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: rdomarat-pc.sybase.com
Message-ID: <415d809e$1@forums-2-dub>
X-Original-Trace: 1 Oct 2004 09:06:54 -0700, rdomarat-pc.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 1 Oct 2004 09:06:55 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 1 Oct 2004 09:06:58 -0700
X-Trace: forums-1-dub 1096646818 10.22.108.75 (1 Oct 2004 09:06:58 -0700)
X-Original-Trace: 1 Oct 2004 09:06:58 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3676
Article PK: 7574

I'm a little confused about why you're asking about binary searches, and
what constitutes a "match". If there's a unique index on
(name,kana,address), then by definition a search for a match on those
columns will always come back empty, since the index will not allow
duplicates.

--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup

iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set "Platform Preview" and "Time Frame" to ALL

"Matt" <nathessATNOSPAMmth.biglobe.ne.jp> wrote in message
news:415ce49e$1@forums-1-dub...
> Can someone give me an example of a binary search?
>
> I have a table called customers and need to do the following
> 1. Compare previous customers (using a binary search) to the new customer
by
> a unique index(name,kana,address)
> 2. If a match is found,
> a) delete the current customer,
> b) cascade through child tables to change the cust_id from the NEW
> value to the OLD value
> c) delete the NEW customer entry.
>
> But have not much of an idea of a binary search other than u r basically
> halving as u go thru the search to eliminate the list as quickly as
> possible?
>
> Thanks
>
> PB9.01
>
>