Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Import Table error
Wed, Mar 6 2019 4:32 AMPermanent Link

Hershcu Sorin

Hello

I want to import a Txt file with the command"
IMPORT TABLE VTempImport FROM "WorkFile.txt"
IN STORE ImportFile DELIMITER CHAR #124

If the txt file include a Quote mark "  
it's cause an error.

How can I avoid it?
Thanks Sorin
Wed, Mar 6 2019 7:28 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Hershcu


Looking at the manual I'm guessing you'd specify [QUOTE CHAR <QuoteChar>]

But then a bit further down it says

If the QUOTE CHAR clause is not included, then the default quote character for character strings is the
double quote '"' character

Just what I'd expect. So I wonder if your text file is not using #34 but is using #147 & #148. Depending on what's produced it you can get the latter which often look the same to the eye depending on font face and size

Roy Lambert
Wed, Mar 6 2019 10:12 AMPermanent Link

Hershcu Sorin

Thanks Roy

I check again.
It's #34

Sorin
Wed, Mar 6 2019 11:04 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Hershcu


In cases like this its almost always the data. What happens if you construct a good file and try and import that. If you get an error what is it.

Roy Lambert
Wed, Mar 6 2019 11:22 AMPermanent Link

Hershcu Sorin

Roy

If it's good file I don't get any error.
On this case the error is: ElevateDB Error #904 Error importing the file....An error occurred with the column Name (The value....would result in truncation))

If I remove the " from file it work ok
Sorin
Thu, Mar 7 2019 4:27 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Hershcu

>If it's good file I don't get any error.
>On this case the error is: ElevateDB Error #904 Error importing the file....An error occurred with the column Name (The value....would result in truncation))

OK, the SQL standard says that if a value is to big to fit in the column then a warning should be issued. With DBISAM string values were truncated, with ElevateDB you get an error. Try increasing the size of the column Name

Roy
Thu, Mar 7 2019 9:22 AMPermanent Link

Hershcu Sorin

Thanks, Roy

I found the solution.
The problem is not the column .size.

All I need was to ignore the double quote with the command:
IMPORT TABLE VTempImport FROM "WorkFile.txt"
IN STORE ImportFile DELIMITER CHAR #124 QUOTE CHAR #0'

Thanks for the support,
Sorin
Image