1. stratacorps
  2. RO CSVI
  3. Tuesday, 17 October 2017
  4.  Subscribe via email
Trying to figure out what I am doing wrong. I have a custom table import that says it is updating the table, but only existing records are getting updated. Inserts for new records aren’t happening. The detailed log shows a mysql update statement being executed even though the key index is “not found” during the select.

What am I missing?
Accepted Answer Pending Moderation
That doesn’t make any sense. Joomla can’t find a row in the database to update because the row with the primary key does not yet exist. So you are telling me I have to delete all the rows in the import table in Joomla! before using CSVI to import new and updated records?

Edit: again, the problem is with adding new records not updating existing records based a the primary key. And if I remove the primary key column from my import csv file, how is it going to know what the key is for the records???
  1. more than a month ago
  2. RO CSVI
  3. # 21
Accepted Answer Pending Moderation
Hello,
But shouldn't the next statement be an INSERT statement instead of UPDATE?

The problem is when Joomla finds the primary key field it assumes that the row is already in the database and does an update. That is what is happening in your custom table import as your CSV file has MemberNbr column which i guess is the primary key of your custom table. You need to remove this column from your CSV file and then run the import so all records gets added. This is also explained in custom table import document under Adding and Updating section.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 22
Accepted Answer Pending Moderation
Just an FYI, I removed CSVI's tables and component from the test site, and re-installed, starting from scratch. No additional plugins, etc.

The log shows that a check is made for the primary key, and even detects that it is a new record...

2017-10-17 15:10:58 7 [QUERY] SELECT `MemberNbr` FROM `xxxxx_district_roster` WHERE `MemberNbr` = '563689999'
2017-10-17 15:10:58 7 [DEBUG] No record found for the given import based on field value

But shouldn't the next statement be an INSERT statement instead of UPDATE?

2017-10-17 15:10:58 7 [DEBUG] Query for Customtable
2017-10-17 15:10:58 7 [QUERY] SELECT `MemberNbr` FROM `xxxxx_district_roster` WHERE `MemberNbr` = '563689999'
2017-10-17 15:10:58 7 [DEBUG] Executed store
2017-10-17 15:10:58 7 [QUERY] UPDATE `jgs5u_district_roster` SET `DistNbr`='99',`ZoneNbr`='01',`ClubName`='TEST, MO',`ClubNbr`='36168',`RosterNbr`='2456',`Gender`='M',`Salutation`='Mr',`FirstName`='John Smith',`LastName`='Smith',`Address1`='333 N South St',`City`='TEST',`State`='AK',`PostalCode`='55512-9125',`Country`='US',`Language`='ENGL',` ... WHERE `MemberNbr` = '563689999'
2017-10-17 15:10:58 7 [DEBUG] Custom table data added
  1. more than a month ago
  2. RO CSVI
  3. # 23
Accepted Answer Pending Moderation
Here are links to the information:


The system reports that records were updated, and I can find where I modify the table and re-import the CSV and existing records are getting updated, but new records are not getting added. I even emptied the destination table and ran the import and got the message that 1,888 records were updated, but the table remained completely empty.

I have also tried some of the advanced options, but with the same result. I used the field mapper to build the template (wonderful, saves time!!) but in a couple of trial attempts I created a test table with the same field names...even though I deleted this later, CSVI still shows the columns/fields from that experiment. Does this cause problems having multiple projects with the same exact field name?
  1. more than a month ago
  2. RO CSVI
  3. # 24
Accepted Answer Pending Moderation
Hello,
Please post your import debug log and sample import file to check.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 25
  • Page :
  • 1
  • 2


There are no replies made for this post yet.
Be one of the first to reply to this post!