1. hoks
  2. RO CSVI
  3. Thursday, 14 July 2016
  4.  Subscribe via email
Hello,

I tryed to import a custom table. CSVI pro 6.6.2 on J3.5.1 But at the import i have an error, see log attachted.

Maybe my created database table is not good, see create in the attachments. My import file also attached.

Can you help me?

Regards Michel
Accepted Answer Pending Moderation
Hello,
To do a custom table import you need a valid primary key field in your import CSV file, your import file has no valid field names and only numbers which will not work. Have a look at custom table import document for more information.
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. # 1
Accepted Answer Pending Moderation
Hello,

I have read this documentation before, but i don't get what i doing wrong. Can you help? Is there a example?

Regards Michel
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello,
but i don't get what i doing wrong. Can you help? Is there a example?

The problem is your import file, You have numbers 1,2,3.. as header in your import file but they should be the name of the field from your custom table csvi_custom_rooster. Also, the table csvi_custom_rooster, Is this table you created? Can you give more details on what you are trying to do?
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. # 3
Accepted Answer Pending Moderation
Hello,

Ok, i changed the header names to kol_1, kol_2....
I have a import file with 31 columns and 1 example row to import, but still an error.

The fields areavailable, see attachment availablefiels.jpg
logfile -> com_csvi.log.40
importfile ->geentitel1.csv
Database table -> qfb67_csvi_custom_rooster.sql (yes, this is the script from creating database table)

Regards Michel


Regards Michel
Attachments (3)
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello Michel,
Ok, i changed the header names to kol_1, kol_2....
I have a import file with 31 columns and 1 example row to import, but still an error.

Kol_1 is the primary key field as per your available fields, First thing is this field should have only numbers and not string. Second is that CSVI will identify if the record has to be inserted or updated using this primary key Kol_1, remove this column from your import file so you have the record inserted. Try doing the import removing this field and see if it helps.
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. # 5
Accepted Answer Pending Moderation
Hello,

I changed kol_1 in the database to Integer.
I removed kol_1 in the import file.
I removed the header line with fieldnames in the importfile.

So far 1 row succeeded to import, but the second import row failed 'Duplicate entry '0' for key 'PRIMARY' SQL=INSERT INTO `#__csvi_custom_rooster` '
No log file.

I think something goed wrong with the unique kol_1

I attached the new files.

Regards Michel
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello Michel,

When you changed kol_1 to integer, did you make it auto increment as well? This is needed to have it filled with a new number. That is the standard definition of a primary key field anyway.

Before you run the import again, make sure to remove the data that is imported now. That auto increment should be the last step as far as I can see.
Kind regards,

RolandD

=========================
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. # 7
Accepted Answer Pending Moderation
No, it was not auto increment. Sorry, not enough database expericience to now this kind of things...

Maybe, just a suggestion, it's an idea to provide a basic import script for a new table in the database. I think that this should help me.

I noticed that if i import the script now 3 times, all rowes are added 3 times. Is it possible to update the rows if they exists?

Regards Michel
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello Michel,
No, it was not auto increment. Sorry, not enough database expericience to now this kind of things...

Thats ok, we do understand the difficulties of a new user.

Maybe, just a suggestion, it's an idea to provide a basic import script for a new table in the database. I think that this should help me.

I dont think you need it any more. You should be good once you set your primary key field.

I noticed that if i import the script now 3 times, all rowes are added 3 times. Is it possible to update the rows if they exists?

For CSVI to update a row you need to include the primary key field in your import file, in your case it is kol_1. For example if you set kol_1 to 1 in your import file the record with primary key value 1 in the database would be updated. CSVI will identify if a row has to be inserted or updated using this primary key field. To be more clear, the primary key field is not needed when you are adding new rows but it is required for updating.
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. # 9
  • Page :
  • 1


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