Importdatabase options not working


#1

i have a database called ‘thenewrecords’ with a single field ‘item’ and 6 records.

in the the database into which i want to import these records, ‘item’ is the second field.

when i run
importdatabase ‘thenewrecords’, ‘matchingfields’, 'yes’
or
openfile '++thenewrecords’
i get 6 new records with NO VALUES in the item field.

when i run
importdatabase 'thenewrecords’
or
openfile '+thenewrecords’
i get 6 new records with values in the first field, which is what you would expect.

so, what’s going on here?


#2

I can confirm this. I also found that it would work correctly if I was matching fields and item was the first field in both databases. It would appear that the bug is in the part about order not being important. Both the order and the names must match in order for the import to work, when you specify matching fields.


#3

I’ve done some additional testing, using a database with multiple fields, and it seems to be working correctly in that database.

I made a copy of a database with 11 fields, and added a twelfth field at the beginning, so that the eleven existing fields were all pushed over one. When I imported, and matched names, the first field was left empty, as it should have been, and the remaining fields were filled correctly. I then switched the order of two of the fields, and tried again, and once again it worked correctly.

It looks like the bug has something to do with the fact that you had only one field to import.


#4

If one of you could send me a zip file with a pair of databases that demonstrates the problem, that would be very helpful.


#5

Example files are now in Bitbucket issue #630.


#6

That’s perfect, thank you Dave.


#7

right. i have no problem importing more than one field.


#8

what’s the status of this issue?

yesterday i did an
    importdatabase ‘matchingfields’, 'yes’
i was importing 6 fields. one of them (coincidently, named ‘item’) would not import.
i ended up rearranging the fields to match the order in the receiving db and importing without matchingfields.
today, using the same 2 files, i couldn’t replicate the problem.
i even tried again with the fields in the wrong order, and the import with matchingfields still worked.


#9

You can sign up for an Atlassian account and then subscribe for notifications to any BitBucket issue:

Once you subscribe to an issue, you’ll get emails whenever there is activity on the issue.

Spoiler alert – I have not worked on this particular issue yet.


#10

i don’t knw how far down your to do list this issue is, jim, but it’s still a problem for me.
today i tried an importdatabase with matchingfields.
six fields in the database being imported.
the first four imported; the last two were just skipped.
i had to rearrange the fields in the receiving database and do importdatabase without options.


#11

It sounds like maybe you have found a new bug? The confirmed but that is in BitBucket only occurs when just one field is being imported. A problem with importing a single field seems like a low priority bug to me. If you’ve found a situation where it fails with multiple fields, please submit a .zip file with an example so that I can duplicate and work on the problem.


#12

ok. i just uploaded files to Issue #630 on your bitbucket.