Results 1 to 4 of 4

Thread: Database Import

  1. #1
    Join Date
    Nov 2010
    Location
    Raleigh, NC
    Posts
    2

    Unanswered: Database Import

    I'm having trouble importing data into a pervasive table. Should be easy, but I'm obviously missing something. I have a table with 3 fields: RowID identity, CatalogID integer, SKU varchar(20). I have a list of several hundred rows that I have tried to import into this table many different ways with and without field name rows. The first attempt was with data rows that look like the following: {1, DABD3106}. {} were not in the row, just wanted to show the start and end of the row. In this case, I was not including the rowid figuring it would auto increment. No good. I then tried rows that looked like the following: {1, 'DABD3106'} figuring the character string might need to be delimited. Also, {1, "DABD3106"}. Then I thought, perhaps I do need to include the RowID. So I then tried {0, 1, DABD3106} and all other variations to no avail. So, figuring that what I've been used to doing in MS SQL wasn't going to work, I went to the documentation for PCC v11 and it seemed to say that I need to preface each row with a character count followed by a comma and then the data. Before I go and do that, I just wanted to ask if that was correct or am I doing something else wrong? Many thanks for any help anyone could provide. Best regards, Don Bouchard

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Your row should look like:
    {0, 1,' DABD3106'}
    based on the field types.
    The identity needs to be 0 to autoincrement. The integer doesn't need delimiting but the string does and it uses single quotes.

    Also, what steps are you taking to import the data? If you're using PCC and the "Import Data", you don't need a record length. If you are using BUTIL -LOAD, you would need a length, a comma, then the "byte image" of the record. For example, the record you mention would look like:
    31,  DABD3106
    Notice the non-printable characters. That's the 1 for the RowID and the 1 for the CatalogID.

    Personally, I would suggest the Import Data option within the PCC. If it still doesn't work, post the actual error or behavior you are seeing.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Nov 2010
    Location
    Raleigh, NC
    Posts
    2

    Data import

    I was using the PCC Import Table context menu command on the table and I did have the record exactly as you had it shown in your response except for the fact that I didn't have a space after the commas which I'm sure hoping doesn't make any difference. In any case, I was so frustrated I ended up writing my own utility program to add the rows and decided to call it a day. I will however, try again with the exact same row as you've shown and then show you the error message I am getting... Thanks for the suggestion!

  4. #4
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Sounds good. Going with a program is probably faster than the Import Data tool anyway.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •