Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: jon bing
  
 Surabaya
 
 jon bing
 Tags
Subject: RE: INSERT COMMAND
Thread ID: 330962 Message ID: 330998 # Views: 43 # Ratings: 3
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Sunday, December 25, 2011 1:32:04 PM         
   


> Dear All,
>
> I always use code below to insert record to MYSQL Product tbale
>
> ex :
>
> x1=sqlexec( nconn ,' insert into product( kode, name) values ( ?productc.kode, ? productc.name)
>
> x1=sqlcommit(nconn)
>
> ( productc is the cursor of product table where I entry or edit the data. )
>
> -------------
> The code above works fine for a small number of fields table, however as the size increased. I found it hard to keep track all the field.
>
> Is it possible to use single command to insert record to my Product table since
> my Productc cursor is EXACTLY THE SAME FIELDS AS THE PRODUCT TABLE?
>
> I'm looking for something like..
>
> Select productc
> scatter memvar
>
> select product
> append blank
> gather memvar
>
> x1=sqlcommit(nconn)
>
> ------------------ so tht I don't have to write the fields one by one.
> I already try some codes like that above, but still can't get it work.
>
> Can anyone please advise,
>
> Thank u
>
> Jon
check out updateable parameterized remote views which you can modify with code like that, then transmit the changes to MySQL with a single TABLEUPDATE() call.
The CursorAdapter class also permits the same facility.

-Anders

ENTIRE THREAD

INSERT COMMAND Posted by jon bing @ 12/25/2011 1:38:35 AM
RE: INSERT COMMAND Posted by Anders Altberg @ 12/25/2011 1:32:04 PM