Article View: borland.public.vdbase.data.sql
Article #501Re: UpdateSet (OK??)
From: brucewm
Date: Wed, 02 Sep 1998 00:00
Date: Wed, 02 Sep 1998 00:00
62 lines
2439 bytes
2439 bytes
brucewm@ix.netcom.com wrote:
>
> Hi all
>
> I'm having a problem with a updateSet class. When I run this the
> destination table's first column gets updated not the specified column.
> The column I need to update is the 4th column to the right.
>
> example:
>
> "Garbage" "Accnt_numb" "First_name" "Accnt_name"
>
> If I enter ("Select garbage, accnt_numb, first_numb, accnt_numb from
> PACESET order by accnt_numb") for the rowset it works fine.
> On a large table I hope that I don't have to specify all column names to
> get to the one I need updated. Here is the code I'm working with.
> I'm new to OODML so please be patient with me. It's time to move ahead.
> ***********************************************************************
> q = new Query()
> q.sql = "select accnt_name from PACESET order by accnt_numb"
> q.active = true
> q.rowset.indexName = "Accnt_numb"
>
> u = new UpdateSet()
>
> u.source = q.rowset
> u.destination = "ACCTTEST.DBF"
> u.changedTableName = "ACCTTEST OLD.DBF"
> u.indexName = "Accnt_numb"
> u.update()
>
> Thanx,
>
> Bruce
I think I answered my own problem (Ya!!!)
This seems to work. Now if i understand this right by using a second
query with only the fields i want updated then when update() executes
the source updates the destination rowsets?. Then writes to the
destination table ?
q = new Query()
q.sql = "select accnt_numb, accnt_name from PACESET order by
accnt_numb"
q.active = true
q.rowset.indexName = "Accnt_numb"
d = new Query()
d.sql = "select accnt_numb, accnt_name from ACCTTEST order by
accnt_numb"
d.active = true
u = new UpdateSet()
u.source = q.rowset
u.destination = d.rowset
u.update()
I'm seeing more ligth @ the end of the tunnel. I can see how this is
much more flexable than DML.
Thanx in adv.
Bruce
Technical Details
Message-ID:
<35EDA25C.5C8F@ix.netcom.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<35EAD8E4.3DFA@ix.netcom.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,a1ee04ee624023bd X-Google-Attributes: gidff5a1,public From: brucewm@ix.netcom.com Subject: Re: UpdateSet (OK??) Date: 1998/09/02 Message-ID: <35EDA25C.5C8F@ix.netcom.com> X-Deja-AN: 387236807 Content-Transfer-Encoding: 7bit References: <35EAD8E4.3DFA@ix.netcom.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.vdbase.data.sql