Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: surinder singh
  Where is surinder singh?
 Hyderabad/New Delhi/Kangra
 India
 surinder singh
 To: Malik Aqeel
  Where is Malik Aqeel?
 Faisalabad
 Pakistan
 Malik Aqeel
 Tags
Subject: RE: how to insert bulk records
Thread ID: 185533 Message ID: 185612 # Views: 26 # Ratings: 0
Version: Visual FoxPro 9 Category: ODBC, ADO and OLEDB
Date: Thursday, July 24, 2008 12:09:56 PM         
   


> >
> > Since you don't know the number of records in the child table, it would be difficult to put this in a procedure. Why don't you put this in a BEGIN TRANSACTION/END TRANSACTION.
> >
> > Regards
> > Tushar
>
> yes i do put in begin/end begin. my question is
> that i call the procedure let us say "master" what is does
> insert a row having information about that voucher and mid (master id)
> than another procedure that put as many rows in the voucher in the detail
> table along with mid (master id). but it all happens by calling the procedure
> each time for each line. question is how to avoid calling procedure of detail
> many time. i need to know how to get rows from cursor and insert these rows all
> to gather in detail table at once.
> hope i could clear the question.
>
> Regards,
> Abdul Aqeel

You can take a look at OPENROWSET function available in SQL.
you can save you cursor as table in your disk and then open that table by using openRowSet() function in SQL stored procedure.
you can access all the records from this table on sql at once with openRowset()

http://fox.wikis.com/wc.dll?Wiki~VisualFoxProDataFromSQLServer~VFP
http://support.microsoft.com/kb/207595


you can search google for more details.

-----------------------------------------------------------------------------------------------
Regards
Surinder Singh
Email: sur200@indiatimes.com
Check my blog for details: http://weblogs.foxite.com/sur200
----------------------------------------------------------------------------------------
*If you understand what you're doing, then you're not learning anything.



COMPLETE THREAD
how to insert bulk records Posted by Malik Aqeel @ 7/24/2008 6:13:26 AM
RE: how to insert bulk records Posted by tushar @ 7/24/2008 6:30:19 AM
RE: how to insert bulk records Posted by Malik Aqeel @ 7/24/2008 11:34:23 AM
RE: how to insert bulk records Posted by surinder singh @ 7/24/2008 12:09:56 PM
RE: how to insert bulk records Posted by Malik Aqeel @ 7/24/2008 1:03:55 PM