Wednesday, August 04, 2004

INSERT ... SELECT SQL and APPEND FROM

I first use INSERT ... SELECT SQL statement in my application to append records from [cursor] A into [cursor] B. Before this, I used APPEND FROM for purpose mentioned above. Unfortunely, I got an error
Error no. : 2119
Error Message : The number of SELECT values doesn't match the number of INSERT columns.
The error message above is very clear. The number of resultset columns to be inserted MUST EXACTLY same with target cursor. Anyhow, I still go thru VFP help file to get *more* information. So dissapointed, error 2119 is not listed in VFP help file. Also, help topic of INSERT...SELECT doesn't mention about this *feature* either. (at least I didn't see any)

Therefore, I got to use APPEND FROM. Suddenly I make up my mind to test the performance of INSERT ... SELECT and APPEND FROM. Guess what result do I get in my testing?

APPEND FROM is 2X faster than INSERT ... SELECT statement.

What make APPEND FROM works faster?
Why does INSERT...SELECT be implemented to force both source and target cursor must have same columns number? Is it so to meet ANSI-92 SQL standard?

4 Comments:

At 3:33 PM, Anonymous Anonymous said...

Nice. Try reading Merriam Webster. It helps bad grammar.

 
At 10:26 PM, Anonymous Anonymous said...

There are times when the 'native approach' in VisualFoxpro executes faster compared to using the 'SQL approach'... especially if one's dealing with N records where NumDigits(N) < 6.

Keep pumping those nice fox blogs.

WildFire

 
At 12:44 PM, Blogger Chan Kok Kiet (John Jones) said...

Thank you for your site. I am trying to improve my english all the time. Any comments are welcome.

 
At 7:18 PM, Anonymous Anonymous said...

Just for the record... I'm not the one who posted the first comment.
[",]

WildFire

 

Post a Comment

<< Home