Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: jon bing
  
 Surabaya
 
 jon bing
 Tags
Subject: INSERT COMMAND
Thread ID: 330962 Message ID: 330962 # Views: 41 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Sunday, December 25, 2011 1:38:35 AM         
   


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

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