Equivalent to FoxPro's 'APPEND' operator

Forum for DBF Commander discussing.

Equivalent to FoxPro's 'APPEND' operator

Postby xess0fd00m » Mon Dec 12, 2022 2:38 pm

Hi,

We just purchased DBFcommander PRO, and I'm trying to create a documentation with equivalent FOXPRO commands. A common use case is to append a table into another table, but the structure of these not always match (column count / names).

The standard FoxPro behavior is:

All rows from TABLE2 are appended to TABLE1;
Columns from TABLE2 that do not exist in TABLE1 are ignored (structure from TABLE1 is kept);
Rows are filled per column, and the order of these do not matter (they're always placed in the correct column).

I've been trying to replicate this with the INSERT and SELECT UNION, but these require matching table structures:

INSERT INTO table1 SELECT * FROM table2
SELECT * FROM table1 UNION ALL SELECT * FROM table2

Is there any way of reproducing the mentioned behavior in DBFcommander?

Thanks a lot,
xess0fd00m
 
Posts: 2
Joined: Mon Dec 12, 2022 2:06 pm

Re: Equivalent to FoxPro's 'APPEND' operator

Postby Admin » Tue Dec 13, 2022 10:59 am

Hello,
I'm sorry, but APPEND clause does not supported in the app. Only SQL statements are allowed.
The INSERT clause matches to all three your rules, if you can enumerate fields in the query, e.g.:
Code: Select all
insert into t1 (f1,f2) select f1,f2 from t2
Best regards,
Oleg Zhechkov
User avatar
Admin
Site Admin
 
Posts: 124
Joined: Wed Apr 21, 2010 7:27 pm

Re: Equivalent to FoxPro's 'APPEND' operator

Postby xess0fd00m » Tue Dec 13, 2022 12:45 pm

Thanks for the reply.

That would be the workaround we'll be using for now, but one of the main benefits of the append operator was not having to enumerate the fields. We have many tables with different structures, but with a similar 'skeleton'. That way, all fields would be copied if they existed, without having to manually enumerate every single one.

Is there anything similar to that I can use?

Thanks a lot once again.
xess0fd00m
 
Posts: 2
Joined: Mon Dec 12, 2022 2:06 pm

Re: Equivalent to FoxPro's 'APPEND' operator

Postby Admin » Tue Dec 13, 2022 12:56 pm

For now, there is no such a workaround. But we'll discuss it and we'll try to implement something similar in future release. I'll notify you once there would be something to test.
Best regards,
Oleg Zhechkov
User avatar
Admin
Site Admin
 
Posts: 124
Joined: Wed Apr 21, 2010 7:27 pm


Return to DBF Commander Professional

Who is online

Users browsing this forum: No registered users and 3 guests

cron