'How to insert multiple rows in Visual FoxPro?

I'm using Visual FoxPro on my Classic ASP website, and I want to achieve the SQL syntax below to FoxPro version 6.

INSERT into users (id, name) 
VALUES 
(1, 'john'),
(2, 'kim'),
(3, 'jake')

But this syntax doesn't recognize by Visual FoxPro.



Solution 1:[1]

No version of Visual FoxPro supports that syntax for multiple row inserts. You will have to issue one insert statement per row.

Solution 2:[2]

Although there are ways to insert multiple rows using Insert sql in VFP for multiple rows, it doesn't directly support it the way you show. Since it is classic ASP page, you should be using a driver in between and if you properly use VFPOLEDB driver, then you are in fact using VFP9 compatible SQL, which you should keep in mind.

As per the values syntax, probably you are not really harcoding those values as in your question but those vaues are coming from some source? If so then better ways migth exists, else easiest would be to do that as multiple inserts.

Solution 3:[3]

I have previously created an XML dataset and called a SP and passed it to allow the SP to parse and insert the data.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alan B
Solution 2 Cetin Basoz
Solution 3 Robert McCarty