If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Database Import

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-14-10, 17:33
Don Bouchard Don Bouchard is offline
Registered User
 
Join Date: Nov 2010
Location: Raleigh, NC
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 11-14-10, 21:08
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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:
Quote:
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.
Reply With Quote
  #3 (permalink)  
Old 11-14-10, 21:18
Don Bouchard Don Bouchard is offline
Registered User
 
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!
Reply With Quote
  #4 (permalink)  
Old 11-15-10, 09:55
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
Reply

Tags
data, import

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On