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.

How to update from a VFP database

4 posts in FoxPro Last posting was on 2012-07-13 20:30:35.0Z
Ken Posted on 2012-07-13 16:56:43.0Z
From: "ken" <kenk@appliedinfogroup.com>
Newsgroups: Advantage.FoxPro
Subject: How to update from a VFP database
Date: Fri, 13 Jul 2012 12:56:43 -0400
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 208.216.217.150
Message-ID: <50005343@solutions.advantagedatabase.com>
X-Trace: 13 Jul 2012 09:56:35 -0700, 208.216.217.150
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.FoxPro:385
Article PK: 1109740

I'm stuck please help. I'm trying to update records on a free database with
data from a fox dbf and I'm confused

as to how to do this.



I'm able to update the file in ADA with a constant successfully........

SQLEXEC( hConn, "update ocpmerg set dstat1='I'", "MyResult" )



but when I try something like this, it returns a -1

SQLEXEC( hConn,"UPDATE ocpmerg as t1, ocproll as t2 SET t1.dstat1 =
t2.dstat1 WHERE t1.orig = t2.orig", "MyResult" )



Should this work or am I on the wrong track and should be using some other
commands?

Should I be using CURSORSETPROP instead of UPDATE?


Joachim Duerr (ADS) Posted on 2012-07-13 19:49:34.0Z
From: "Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Subject: Re: How to update from a VFP database
Newsgroups: Advantage.FoxPro
References: <50005343@solutions.advantagedatabase.com>
Date: Fri, 13 Jul 2012 21:49:34 +0200
User-Agent: XanaNews/1.19.1.320
X-Face: u2p+</,mb|Ah!x!/qxX5q0t:O~.<1&JzwNHYhSqcviY{~&|iDc"U.Je1A.ZeHR`d;;y#R
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 78.52.47.99
Message-ID: <50007c15$1@solutions.advantagedatabase.com>
X-Trace: 13 Jul 2012 12:50:45 -0700, 78.52.47.99
Lines: 14
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.FoxPro:386
Article PK: 1109739


ken wrote:

>SQLEXEC( hConn,"UPDATE ocpmerg as t1, ocproll as t2 SET t1.dstat1 =
>t2.dstat1 WHERE t1.orig = t2.orig", "MyResult" )

you can only specify one table to be updated.
to get what you want, check out the update...from example in the help
file:
http://devzone.advantagedatabase.com/dz/webhelp/Advantage10.1/index.html?master_update.htm

--
Joachim Duerr, Advantage Presales

ADS books available on http://pocketguide.jd-engineering.de


Ken Posted on 2012-07-13 20:10:17.0Z
From: "ken" <kenk@appliedinfogroup.com>
Newsgroups: Advantage.FoxPro
References: <50005343@solutions.advantagedatabase.com> <50007c15$1@solutions.advantagedatabase.com>
Subject: Re: How to update from a VFP database
Date: Fri, 13 Jul 2012 16:10:17 -0400
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 208.216.217.150
Message-ID: <500080a8$1@solutions.advantagedatabase.com>
X-Trace: 13 Jul 2012 13:10:16 -0700, 208.216.217.150
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.FoxPro:387
Article PK: 1109741


"Joachim Duerr (ADS)" <jojo.duerr@gmx.de> wrote in message
news:50007c15$1@solutions.advantagedatabase.com...
> ken wrote:
>
>>SQLEXEC( hConn,"UPDATE ocpmerg as t1, ocproll as t2 SET t1.dstat1 =
>>t2.dstat1 WHERE t1.orig = t2.orig", "MyResult" )
>
> you can only specify one table to be updated.
> to get what you want, check out the update...from example in the help
> file:
> http://devzone.advantagedatabase.com/dz/webhelp/Advantage10.1/index.html?master_update.htm
>
> --
> Joachim Duerr, Advantage Presales
>
> ADS books available on http://pocketguide.jd-engineering.de

I only want to update one table, the table ocpmerg with data from fox table
ocproll.


Ken Posted on 2012-07-13 20:30:35.0Z
From: "ken" <kenk@appliedinfogroup.com>
Newsgroups: Advantage.FoxPro
References: <50005343@solutions.advantagedatabase.com> <50007c15$1@solutions.advantagedatabase.com> <500080a8$1@solutions.advantagedatabase.com>
Subject: Re: How to update from a VFP database
Date: Fri, 13 Jul 2012 16:30:35 -0400
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 208.216.217.150
Message-ID: <50008564$1@solutions.advantagedatabase.com>
X-Trace: 13 Jul 2012 13:30:28 -0700, 208.216.217.150
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.FoxPro:388
Article PK: 1109742

I see now, maybe I should be using something like this ..........

UPDATE suppliers

SET supplier_name = ( SELECT customers.name

FROM customers

WHERE customers.customer_id = suppliers.supplier_id)

WHERE EXISTS

( SELECT customers.name

FROM customers

WHERE customers.customer_id = suppliers.supplier_id);

"ken" <kenk@appliedinfogroup.com> wrote in message
news:500080a8$1@solutions.advantagedatabase.com...
>
> "Joachim Duerr (ADS)" <jojo.duerr@gmx.de> wrote in message
> news:50007c15$1@solutions.advantagedatabase.com...
>> ken wrote:
>>
>>>SQLEXEC( hConn,"UPDATE ocpmerg as t1, ocproll as t2 SET t1.dstat1 =
>>>t2.dstat1 WHERE t1.orig = t2.orig", "MyResult" )
>>
>> you can only specify one table to be updated.
>> to get what you want, check out the update...from example in the help
>> file:
>> http://devzone.advantagedatabase.com/dz/webhelp/Advantage10.1/index.html?master_update.htm
>>
>> --
>> Joachim Duerr, Advantage Presales
>>
>> ADS books available on http://pocketguide.jd-engineering.de
>
> I only want to update one table, the table ocpmerg with data from fox
> table ocproll.
>
>